/* =====================================================
   SINSAJO CREATORS BLOG - STYLES
   Premium Blog Design with Dark/Light Theme Support
   ===================================================== */

/* ============================================ */
/* CSS Variables */
/* ============================================ */
:root {
    --blog-primary: #8B5CF6;
    --blog-secondary: #06B6D4;
    --blog-accent: #F472B6;
    --blog-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ============================================ */
/* Blog Hero */
/* ============================================ */
.blog-hero {
    background: var(--blog-gradient);
    padding: 140px 20px 80px;
    text-align: center;
    color: white;
}

.blog-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 50px 18px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255,255,255,0.95);
    color: #1f2937;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
}

/* ============================================ */
/* Category Filter */
/* ============================================ */
.category-filter {
    padding: 30px 20px;
    background: var(--theme-bg, #ffffff);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.filter-btn {
    padding: 12px 28px;
    border: 2px solid var(--blog-primary);
    background: transparent;
    color: var(--blog-primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--blog-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* ============================================ */
/* Featured Article */
/* ============================================ */
.featured-article {
    padding: 60px 20px;
    background: var(--theme-bg, #f8fafc);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--theme-text, #1f2937);
}

.featured-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.15);
}

.featured-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.featured-image {
    flex: 0 0 50%;
    height: 400px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 12px 0 16px;
    color: #1f2937;
    line-height: 1.3;
}

.featured-content p {
    font-size: 1.1rem;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ============================================ */
/* Articles Grid */
/* ============================================ */
.articles-section {
    padding: 60px 20px 80px;
    background: var(--theme-bg, #ffffff);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

.article-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

.article-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-image {
    height: 220px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.08);
}

.article-content {
    padding: 28px;
}

.article-category {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--blog-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 14px 0 12px;
    color: #1f2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-content p {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #9ca3af;
}

.article-meta i {
    margin-right: 6px;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    color: #6b7280;
}

/* ============================================ */
/* Newsletter Section */
/* ============================================ */
.newsletter-section {
    padding: 80px 20px;
    background: var(--blog-gradient);
    text-align: center;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    color: white;
}

.newsletter-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.newsletter-content > p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
}

.newsletter-form button {
    padding: 16px 32px;
    background: white;
    color: var(--blog-primary);
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.newsletter-note {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* ============================================ */
/* Newsletter Popup */
/* ============================================ */
.newsletter-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.newsletter-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    border-radius: 24px;
    padding: 48px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.newsletter-popup.active .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.popup-close:hover {
    color: #1f2937;
}

.popup-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1f2937;
}

.popup-content .emoji {
    font-style: normal;
}

.popup-content > p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 1.05rem;
}

.popup-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.popup-form input:focus {
    border-color: var(--blog-primary);
}

.popup-form button {
    width: 100%;
    padding: 16px;
    background: var(--blog-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.popup-note {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 16px;
}

/* ============================================ */
/* Footer */
/* ============================================ */
.blog-footer {
    background: #111827;
    color: white;
    padding: 60px 20px 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    height: 40px;
    margin-bottom: 16px;
}

.footer-brand p {
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1.6;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    color: #9ca3af;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-contact i {
    margin-right: 10px;
    color: var(--blog-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ============================================ */
/* Dark Theme Overrides */
/* ============================================ */
.dark-theme .category-filter,
.dark-theme .articles-section {
    background: #111827;
}

.dark-theme .featured-article {
    background: #1f2937;
}

.dark-theme .section-title {
    color: #f3f4f6;
}

.dark-theme .featured-card,
.dark-theme .article-card {
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
}

.dark-theme .featured-content h3,
.dark-theme .article-content h3 {
    color: #f3f4f6;
}

.dark-theme .featured-content p,
.dark-theme .article-content p {
    color: #9ca3af;
}

.dark-theme .filter-btn {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
}

.dark-theme .filter-btn.active {
    background: var(--blog-primary);
    color: white;
}

.dark-theme .search-input {
    background: rgba(31, 41, 55, 0.95);
    color: #f3f4f6;
    border: 1px solid rgba(255,255,255,0.1);
}

.dark-theme .search-input::placeholder {
    color: #6b7280;
}

/* ============================================ */
/* Responsive Design */
/* ============================================ */
@media (max-width: 1024px) {
    .featured-link {
        flex-direction: column;
    }

    .featured-image {
        height: 300px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }

    .newsletter-content h2 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .popup-content {
        padding: 32px 24px;
    }

    .featured-content {
        padding: 28px;
    }

    .featured-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 120px 16px 60px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* ============================================ */
/* Mobile Menu Fixes */
/* ============================================ */
@media (max-width: 768px) {
    /* Ensure hamburger is visible */
    .hamburger {
        display: flex !important;
        z-index: 1001;
    }

    /* Hide desktop nav links */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
        flex-direction: column;
        padding: 100px 30px 40px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 40px rgba(0,0,0,0.3);
        z-index: 1000;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links ul li a {
        display: block;
        padding: 18px 20px;
        font-size: 1.1rem;
        color: rgba(255,255,255,0.9);
        transition: all 0.3s ease;
    }

    .nav-links ul li a:hover,
    .nav-links ul li a.active {
        background: rgba(139, 92, 246, 0.2);
        color: #a78bfa;
        padding-left: 28px;
    }

    /* Mobile menu overlay */
    body.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Header right section on mobile */
    .header-right {
        display: none;
    }

    .nav-links.active ~ .header-right,
    .nav-links .header-right-mobile {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 30px;
        padding-top: 30px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
}

/* ============================================ */
/* Enhanced Newsletter Popup */
/* ============================================ */
.newsletter-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
}

.newsletter-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 28px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
}

.newsletter-popup.active .popup-content {
    transform: scale(1) translateY(0);
}

/* Popup icon/badge */
.popup-content::before {
    content: '🎁';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

.popup-content h3 {
    font-size: 1.9rem;
    font-weight: 800;
    margin: 20px 0 16px;
    color: #1f2937;
    line-height: 1.2;
}

.popup-content > p {
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Benefits badges */
.popup-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.popup-benefit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 50px;
    font-size: 0.9rem;
    color: #5b21b6;
    font-weight: 500;
}

.popup-form input {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 1.05rem;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.popup-form input:focus {
    border-color: var(--blog-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.popup-form button {
    width: 100%;
    padding: 18px;
    background: var(--blog-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.popup-form button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.popup-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.popup-form button:hover::after {
    transform: translateX(100%);
}

.popup-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.popup-form button.loading {
    pointer-events: none;
}

.popup-form button.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.popup-note {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 20px;
}

.popup-note i {
    margin-right: 6px;
}

/* Success state */
.popup-success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.popup-success.show {
    display: block;
}

.popup-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-success-icon i {
    font-size: 2.5rem;
    color: white;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.popup-success h4 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 12px;
}

.popup-success p {
    color: #6b7280;
}

/* Hide form when success */
.popup-content.success .popup-form,
.popup-content.success > p,
.popup-content.success .popup-benefits,
.popup-content.success .popup-note {
    display: none;
}

.popup-content.success .popup-success {
    display: block;
}

@media (max-width: 480px) {
    .popup-content {
        padding: 40px 24px;
        border-radius: 20px;
    }

    .popup-content::before {
        font-size: 2.5rem;
        top: -24px;
    }

    .popup-content h3 {
        font-size: 1.5rem;
    }

    .popup-benefits {
        flex-direction: column;
    }
}
