/**
 * Jambvant AI News Page Styles
 * Glass-neumorphism design with MSN-inspired layout
 */

/* =============================================
   PAGE LAYOUT
   ============================================= */

.news-page {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 60px;
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(255, 245, 230, 0.5) 100%);
}

[data-theme="dark"] .news-page {
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
}

.news-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* =============================================
   PAGE HEADER
   ============================================= */

.news-header {
    text-align: center;
    margin-bottom: 32px;
}

.news-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-subtitle {
    font-size: 18px;
    color: var(--text-gray);
    font-weight: 400;
}

[data-theme="dark"] .news-title {
    background: linear-gradient(135deg, #FF8C00 0%, #FFB347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   SEARCH BAR
   ============================================= */

.news-search-container {
    margin-bottom: 24px;
    padding: 16px 20px;
}

.news-search-wrapper {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.news-search-input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow:
        inset 2px 2px 4px var(--glass-neu-dark),
        inset -2px -2px 4px var(--glass-neu-light);
}

.news-search-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow:
        inset 2px 2px 4px var(--glass-neu-dark),
        inset -2px -2px 4px var(--glass-neu-light),
        0 0 0 3px var(--glass-neu-orange-glow);
}

.news-search-input::placeholder {
    color: var(--text-gray);
    opacity: 0.7;
}

[data-theme="dark"] .news-search-input {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.news-search-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple) 0%, #FFA500 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow:
        4px 4px 12px var(--glass-neu-dark),
        -4px -4px 12px var(--glass-neu-light);
}

.news-search-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 16px var(--glass-neu-dark),
        -6px -6px 16px var(--glass-neu-light),
        0 4px 20px var(--glass-neu-orange-glow);
}

/* =============================================
   REGION FILTER TABS
   ============================================= */

.region-tabs {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: center;
    flex-wrap: wrap;
}

.region-tabs::-webkit-scrollbar {
    display: none;
}

.region-tab {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow:
        3px 3px 8px var(--glass-neu-dark),
        -3px -3px 8px var(--glass-neu-light);
}

.region-tab:hover {
    transform: translateY(-2px);
    box-shadow:
        4px 4px 12px var(--glass-neu-dark),
        -4px -4px 12px var(--glass-neu-light),
        0 4px 12px var(--glass-neu-orange-glow);
}

.region-tab.active {
    background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
    color: white;
    border-color: transparent;
    box-shadow:
        4px 4px 12px rgba(255, 140, 0, 0.3),
        -4px -4px 12px var(--glass-neu-light),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .region-tab {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

[data-theme="dark"] .region-tab.active {
    background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
    color: white;
}

/* =============================================
   SAVED ARTICLES TOGGLE
   ============================================= */

.saved-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.saved-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        3px 3px 8px var(--glass-neu-dark),
        -3px -3px 8px var(--glass-neu-light);
}

.saved-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        4px 4px 12px var(--glass-neu-dark),
        -4px -4px 12px var(--glass-neu-light);
}

.saved-toggle-btn.active {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: white;
    border-color: transparent;
}

.saved-count {
    background: var(--primary-purple);
    color: white;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.saved-toggle-btn.active .saved-count {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .saved-toggle-btn {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* =============================================
   HERO SECTION (Featured + Top Stories)
   ============================================= */

.news-hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .news-hero-section {
        grid-template-columns: 1fr;
    }
}

/* Featured Story Card */
.featured-story {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    border-radius: 24px;
}

.featured-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

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

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

.featured-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
}

.featured-region-badge {
    background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.featured-content {
    padding: 24px;
}

.featured-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-description {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

.featured-source {
    font-weight: 600;
    color: var(--primary-purple);
}

.featured-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow:
        2px 2px 6px var(--glass-neu-dark),
        -2px -2px 6px var(--glass-neu-light);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        3px 3px 10px var(--glass-neu-dark),
        -3px -3px 10px var(--glass-neu-light);
}

.action-btn.saved {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

[data-theme="dark"] .action-btn {
    background: rgba(50, 50, 50, 0.9);
}

/* Top Stories Sidebar */
.top-stories {
    padding: 20px;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.top-stories-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-purple);
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-stories-header::before {
    content: '🔥';
}

.top-stories-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.top-story-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.4);
}

.top-story-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
    box-shadow: 0 4px 12px var(--glass-neu-orange-glow);
}

[data-theme="dark"] .top-story-item {
    background: rgba(40, 40, 40, 0.6);
}

[data-theme="dark"] .top-story-item:hover {
    background: rgba(50, 50, 50, 0.9);
}

.top-story-image {
    width: 80px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.top-story-content {
    flex: 1;
    min-width: 0;
}

.top-story-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.top-story-meta {
    font-size: 12px;
    color: var(--text-gray);
}

/* =============================================
   NEWS GRID
   ============================================= */

.news-grid-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '📰';
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* News Card */
.news-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow:
        8px 8px 24px var(--glass-neu-dark),
        -8px -8px 24px var(--glass-neu-light),
        inset 0 1px 1px rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow:
        10px 10px 32px var(--glass-neu-dark-strong),
        -10px -10px 32px var(--glass-neu-light),
        0 8px 32px var(--glass-neu-orange-glow);
}

[data-theme="dark"] .news-card {
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.news-card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

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

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

.news-card-region-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 140, 0, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.news-card:hover .news-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.news-card-action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.news-card-action-btn:hover {
    transform: scale(1.1);
    background: white;
}

.news-card-action-btn.saved {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.news-card-content {
    padding: 20px;
}

.news-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-description {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-gray);
}

.news-card-source {
    font-weight: 600;
    color: var(--primary-purple);
}

/* =============================================
   LOAD MORE BUTTON
   ============================================= */

.load-more-container {
    text-align: center;
    margin-bottom: 40px;
}

.load-more-btn {
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        6px 6px 16px var(--glass-neu-dark),
        -6px -6px 16px var(--glass-neu-light);
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
    color: white;
    border-color: transparent;
    box-shadow:
        8px 8px 20px rgba(255, 140, 0, 0.3),
        -8px -8px 20px var(--glass-neu-light);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

[data-theme="dark"] .load-more-btn {
    background: rgba(40, 40, 40, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* =============================================
   LOADING, ERROR, EMPTY STATES
   ============================================= */

.news-loading,
.news-error,
.news-empty {
    text-align: center;
    padding: 80px 20px;
}

.news-loading .spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 140, 0, 0.2);
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.news-loading p,
.news-error .error-message,
.news-empty .empty-message {
    font-size: 16px;
    color: var(--text-gray);
}

.news-error .error-icon,
.news-empty .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.news-empty .empty-hint {
    font-size: 14px;
    color: var(--text-gray);
    opacity: 0.7;
    margin-top: 8px;
}

.btn-retry {
    margin-top: 20px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
}

/* =============================================
   SHARE MODAL
   ============================================= */

.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: var(--primary-purple);
    color: white;
}

.share-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        3px 3px 8px var(--glass-neu-dark),
        -3px -3px 8px var(--glass-neu-light);
}

.share-platform-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        4px 4px 12px var(--glass-neu-dark),
        -4px -4px 12px var(--glass-neu-light);
}

.share-platform-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
    border-color: transparent;
}

.share-platform-btn.linkedin:hover {
    background: #0A66C2;
    color: white;
    border-color: transparent;
}

.share-platform-btn.whatsapp:hover {
    background: #25D366;
    color: white;
    border-color: transparent;
}

.share-platform-btn.copy:hover {
    background: var(--primary-purple);
    color: white;
    border-color: transparent;
}

.platform-icon {
    font-size: 28px;
    font-weight: 700;
}

.platform-name {
    font-size: 13px;
    font-weight: 500;
}

[data-theme="dark"] .share-platform-btn {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* =============================================
   FOOTER
   ============================================= */

.news-footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    padding: 40px 20px 24px;
}

[data-theme="dark"] .news-footer {
    background: rgba(20, 20, 20, 0.95);
    border-top-color: rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-purple);
    text-decoration: none;
}

.footer-tagline {
    font-size: 14px;
    color: var(--text-gray);
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a.active {
    color: var(--primary-purple);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-gray);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 768px) {
    .news-container {
        padding: 24px 16px;
    }

    .news-title {
        font-size: 32px;
    }

    .news-subtitle {
        font-size: 15px;
    }

    .news-search-wrapper {
        flex-direction: column;
    }

    .news-search-btn {
        width: 100%;
        height: 48px;
        border-radius: 50px;
    }

    .region-tabs {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .region-tab {
        padding: 8px 16px;
        font-size: 13px;
    }

    .news-hero-section {
        grid-template-columns: 1fr;
    }

    .featured-title {
        font-size: 20px;
    }

    .featured-description {
        font-size: 14px;
    }

    .top-stories {
        max-height: none;
    }

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

    .section-title {
        font-size: 20px;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .news-title {
        font-size: 28px;
    }

    .region-tabs {
        gap: 8px;
    }

    .region-tab {
        padding: 6px 12px;
        font-size: 12px;
    }

    .saved-toggle-container {
        justify-content: center;
    }
}
