/**
 * Newsletter Dashboard Styles
 * Beautiful, modern design for newsletter listing and detail pages
 */

/* ================================
   Language Switcher
   ================================ */

.language-switcher {
    position: fixed;
    top: 80px;
    right: 2rem;
    z-index: 100;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 0;
    padding: 0.375rem;
}

.language-switcher button {
    background: transparent;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher button:hover {
    color: #667eea;
}

.language-switcher button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.language-switcher button i {
    font-size: 1rem;
}

/* ================================
   Newsletter Hero Section
   ================================ */

.newsletter-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect fill="rgba(255,255,255,0.05)" x="0" y="0" width="50" height="50"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.newsletter-hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.newsletter-hero p {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    color: #ffffff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

/* ================================
   Newsletter Container & Grid
   ================================ */

.newsletter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: 60vh;
}

.newsletters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ================================
   Newsletter Card
   ================================ */

.newsletter-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.newsletter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.newsletter-lock {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.newsletter-card-header {
    margin-bottom: 1rem;
}

.newsletter-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.newsletter-date {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
}

.newsletter-preview {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.newsletter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.newsletter-tags .tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.newsletter-card-footer {
    margin-top: auto;
}

.read-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.read-more-btn i {
    transition: transform 0.3s;
}

.read-more-btn:hover i {
    transform: translateX(4px);
}

/* ================================
   Paywall Modal
   ================================ */

.newsletter-paywall-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.newsletter-paywall-modal.active {
    display: flex;
}

.paywall-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.paywall-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: paywall-slide-up 0.3s ease;
}

@keyframes paywall-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.paywall-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.paywall-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.paywall-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.paywall-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.paywall-content p {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9375rem;
}

.paywall-benefits {
    list-style: none;
    margin: 1rem 0;
    text-align: left;
}

.paywall-benefits li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #475569;
    font-size: 0.9375rem;
}

.paywall-benefits li i {
    color: #10b981;
    font-size: 1rem;
}

.paywall-pricing {
    display: flex;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.pricing-option {
    flex: 1;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem 0.625rem;
    position: relative;
}

.pricing-option.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pricing-option .badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #78350f;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pricing-option .price-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.pricing-option .price {
    display: block;
    font-size: 1.375rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.pricing-option .price-period {
    display: block;
    font-size: 0.625rem;
    opacity: 0.7;
}

.paywall-cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    margin-top: 0.75rem;
}

.paywall-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.paywall-note {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ================================
   Pagination
   ================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.pagination-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    color: #64748b;
    font-weight: 600;
}

/* ================================
   States (Loading, Error, Empty)
   ================================ */

.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 400px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p,
.error-state p,
.empty-state p {
    color: #64748b;
    margin-top: 1rem;
    font-size: 1.125rem;
}

.error-state i,
.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.error-state h3,
.empty-state h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.retry-button {
    margin-top: 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.retry-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* ================================
   Newsletter Detail Page
   ================================ */

.newsletter-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

.newsletter-detail-header {
    margin-bottom: 3rem;
    text-align: center;
}

.newsletter-detail-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.newsletter-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    color: #64748b;
    font-size: 0.9375rem;
    flex-wrap: wrap;
}

.newsletter-content {
    background: white;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    line-height: 1.8;
    font-size: 1.125rem;
    color: #334155;
}

.newsletter-content h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 28px 0 16px 0;
    line-height: 1.3;
}

.newsletter-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 24px 0 12px 0;
    line-height: 1.4;
}

.newsletter-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 20px 0 8px 0;
    line-height: 1.4;
}

.newsletter-content p {
    margin-bottom: 16px;
    color: #1C1C1E;
    line-height: 1.6;
}

.newsletter-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem auto;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.newsletter-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.newsletter-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
    font-weight: 600;
}

.newsletter-content a:hover {
    color: #764ba2;
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.05);
    padding: 0 4px;
}

.newsletter-content ul,
.newsletter-content ol {
    margin: 16px 0;
    padding-left: 20px;
}

.newsletter-content li {
    margin-bottom: 8px;
    color: #1C1C1E;
    line-height: 1.6;
}

.newsletter-content ul li {
    list-style-type: disc;
}

.newsletter-content ol li {
    list-style-type: decimal;
}

.newsletter-content blockquote {
    border-left: 4px solid #007AFF;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #6B7280;
}

.newsletter-content code {
    background: #f1f3f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.newsletter-content strong {
    font-weight: 600;
    color: #1C1C1E;
}

.newsletter-content em {
    font-style: italic;
}

.newsletter-paywall-banner {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.newsletter-paywall-banner h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.newsletter-paywall-banner p {
    margin-bottom: 1rem;
    opacity: 0.95;
}

.newsletter-paywall-banner .cta-button {
    background: white;
    color: #667eea;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: all 0.3s;
}

.newsletter-paywall-banner .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 768px) {
    .language-switcher {
        top: auto;
        bottom: 2rem;
        right: 50%;
        transform: translateX(50%);
    }

    .language-switcher button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .newsletter-hero {
        padding: 6rem 1.5rem 3rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .newsletters-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .newsletter-paywall-modal {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .paywall-content {
        padding: 1.75rem 1.25rem;
        max-height: 85vh;
        margin: auto 0;
    }

    .paywall-icon {
        width: 50px;
        height: 50px;
        margin: 0 auto 0.75rem;
    }

    .paywall-icon i {
        font-size: 1.25rem;
    }

    .paywall-pricing {
        flex-direction: column;
    }

    .newsletter-detail-container {
        padding: 6rem 1.5rem 2rem;
    }

    .newsletter-content {
        padding: 2rem 1.5rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .newsletter-paywall-modal {
        padding: 0.5rem;
        padding-top: 2rem;
    }

    .paywall-content {
        padding: 1.5rem 1rem;
        max-height: 80vh;
        border-radius: 16px;
    }

    .paywall-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
    }

    .paywall-icon {
        width: 45px;
        height: 45px;
    }

    .paywall-icon i {
        font-size: 1.125rem;
    }

    .paywall-content h2 {
        font-size: 1.25rem;
    }

    .paywall-pricing {
        gap: 0.625rem;
    }
}
