/* CSS Variables */
:root {
    /* Primary Colors */
    --primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --primary-solid: #667eea;
    --secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --secondary-solid: #f093fb;
    --accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-solid: #4facfe;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Box Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-solid);
    transition: color 0.3s ease;
}

a:hover {
    color: #5568bd;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================== General Layout ================== */
.hero {
    padding: 80px 0 60px;
    background-image: var(--primary);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: var(--shadow-sm);
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-800);
    position: relative;
    padding-bottom: 8px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-solid);
    border-radius: 2px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background-color: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.filter-header h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
}

.search-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: center;
    width: 100%;
    max-width: 700px;
}

.search-group input,
.search-group select {
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-group input:focus,
.search-group select:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.search-group button {
    padding: 12px 24px;
    background-image: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-group button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    padding-bottom: 60px;
}

/* ================== News Card ================== */
.news-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.15), 0 5px 10px -5px rgba(0, 0, 0, 0.05);
}

.news-card a {
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card .card-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.news-card .card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-img-container img {
    transform: scale(1.05);
}

.news-card .badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.news-card .card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card .card-content .card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.news-card .card-content .card-meta i {
    color: var(--primary-solid);
}

.news-card h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.news-card p {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 20px;
    flex-grow: 1;
}

.news-card .read-more {
    font-weight: 600;
    color: var(--primary-solid);
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-card .read-more:hover {
    text-decoration: underline;
}

/* ================== Pagination ================== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-top: 1px solid var(--gray-200);
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover,
.pagination a.active {
    background-image: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* ================== News Detail Page ================== */
.news-detail-page {
    padding-top: 40px;
}

.breadcrumb-section {
    padding: 16px 0;
    background-color: var(--gray-50);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
}

.breadcrumb a {
    color: var(--gray-600);
}

.breadcrumb a:hover {
    color: var(--primary-solid);
}

.breadcrumb i {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.breadcrumb span {
    color: var(--primary-solid);
    font-weight: 500;
}

.article-header-section {
    padding: 40px 0;
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.article-header {
    text-align: center;
}

.article-header h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 24px;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.meta-group {
    display: flex;
    gap: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item i {
    color: var(--primary-solid);
}

.article-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.action-btn:hover {
    background-color: var(--primary-solid);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.article-content-section {
    padding: 60px 0;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
}

.article-main {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-main p {
    margin-bottom: 24px;
}

.article-main img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
    box-shadow: var(--shadow-lg);
}

.article-gallery {
    margin-bottom: 40px;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.gallery-expand {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.gallery-expand:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.thumbnail-gallery {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-solid);
    opacity: 1;
}

/* Article Footer (Tags and Social Share) */
.article-footer {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--gray-200);
}

.tags-section h4,
.social-share h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: var(--gray-100);
    color: var(--gray-700);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tag:hover {
    background-image: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--white);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-btn.facebook { background-color: #3b5998; }
.social-btn.twitter { background-color: #1da1f2; }
.social-btn.linkedin { background-color: #0077b5; }
.social-btn.whatsapp { background-color: #25d366; }

.pagination-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid var(--gray-200);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--gray-700);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-btn:hover {
    color: var(--primary-solid);
}

.nav-btn.prev { align-items: flex-start; text-align: left; }
.nav-btn.next { align-items: flex-end; text-align: right; }

.nav-btn small {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--gray-500);
    transition: color 0.3s ease;
}

.nav-btn:hover small {
    color: var(--primary-solid);
}

/* ================== Sidebar ================== */
.article-sidebar {
    position: sticky;
    top: 24px;
}

.related-articles-widget {
    background-color: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.related-articles-widget h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.related-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.related-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    color: var(--gray-800);
}

.related-card:hover {
    background-color: var(--gray-50);
}

.related-img-container {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-img-placeholder {
    width: 80px;
    height: 80px;
    background-color: var(--gray-200);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 2rem;
    flex-shrink: 0;
}

.related-content h4 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 4px;
}

.related-content p {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.no-related {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    padding: 24px;
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
}

/* ================== Utility Classes & Animations ================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-image: var(--accent);
    width: 0%;
    z-index: 999;
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoom 0.6s;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 12px;
}

.lightbox-close,
.lightbox-nav-btn {
    position: absolute;
    color: var(--white);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.lightbox-close {
    top: 20px;
    right: 30px;
}

.lightbox-nav-btn {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-nav-btn.prev-btn { left: 20px; }
.lightbox-nav-btn.next-btn { right: 20px; }

.lightbox-close:hover,
.lightbox-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    background: rgba(118, 75, 162, 0.1);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.shape-1 { width: 150px; height: 150px; top: 10%; left: 5%; }
.shape-2 { width: 250px; height: 250px; bottom: 15%; right: 10%; animation-delay: 5s; }
.shape-3 { width: 100px; height: 100px; top: 50%; left: 30%; animation-delay: 10s; }
.shape-4 { width: 200px; height: 200px; top: 20%; right: 25%; animation-delay: 15s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(15deg); }
}

@keyframes zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Message Box */
.message-box-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-box-overlay.show {
    display: flex;
    opacity: 1;
}

.message-box {
    background-color: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.message-box-overlay.show .message-box {
    transform: scale(1);
}

.message-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.message-box-header h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-solid);
}

.message-box-header .close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-500);
    cursor: pointer;
}

.message-box-content p {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.message-box-actions {
    text-align: right;
}

.message-box-actions .action-btn {
    padding: 10px 24px;
    border-radius: 8px;
    background-image: var(--primary);
    color: var(--white);
    font-weight: 600;
}

/* ================== Media Queries ================== */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .article-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .section-header h2 {
        font-size: 2rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-card {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination {
        justify-content: center;
    }

    .article-header h1 {
        font-size: 2.5rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 16px;
    }
    
    .article-actions {
        margin-top: 16px;
    }

    .social-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .search-group input,
    .search-group select,
    .search-group button {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .news-card .card-content {
        padding: 16px;
    }
    
    .news-card h3 {
        font-size: 1.25rem;
    }

    .article-header h1 {
        font-size: 2rem;
    }

    .pagination-nav {
        flex-direction: column;
        gap: 20px;
    }

    .nav-btn.prev, .nav-btn.next {
        text-align: center;
        align-items: center;
    }
}

