/* ===========================================
   PAGES.CSS - Page-Specific Styles
   =========================================== */

/* ===== HOME PAGE ===== */
.home-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-pattern.svg') repeat;
    opacity: 0.1;
}

.home-hero__content {
    position: relative;
    z-index: 1;
    color: #fff;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.home-hero__title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
}

.home-hero__subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.home-hero__search {
    max-width: 500px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.home-hero__search .search-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    overflow: hidden;
    display: flex;
    box-shadow: var(--shadow-xl);
}

.home-hero__search .search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    background: transparent;
}

.home-hero__search .search-box button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.home-hero__search .search-box button:hover {
    background: var(--primary-dark);
}

/* Featured Categories Grid */
.featured-categories {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-card__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.category-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-card__count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Latest Articles Section */
.latest-articles {
    padding: 4rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.section-header .view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header .view-all:hover {
    text-decoration: underline;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 4rem 0;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item__number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-item__label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Newsletter Section */
.newsletter-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.newsletter-box {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-box h2 {
    margin-bottom: 1rem;
}

.newsletter-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.newsletter-form button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

/* ===== CATEGORY PAGES ===== */
.category-page {
    padding: 2rem 0;
}

.category-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 3rem 0;
    color: white;
    margin-bottom: 2rem;
}

.category-header__content {
    max-width: 800px;
}

.category-header__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-header__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.category-header__description {
    font-size: 1.125rem;
    opacity: 0.9;
}

.category-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.category-main {
    min-width: 0;
}

.category-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Filters */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.filter-bar__sort select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.filter-bar__view {
    display: flex;
    gap: 0.5rem;
}

.filter-bar__view button {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-bar__view button.active,
.filter-bar__view button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== ARTICLE PAGE ===== */
.article-page {
    padding: 2rem 0;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.article-main {
    min-width: 0;
}

.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Article Header */
.article-header {
    margin-bottom: 2rem;
}

.article-header__breadcrumb {
    margin-bottom: 1rem;
}

.article-header__category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.article-header__title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.article-header__meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Article Featured Image */
.article-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article Content */
.article-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.article-content pre {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.article-content code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.article-content p code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--primary-color);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-content a:hover {
    color: var(--primary-dark);
}

/* Article Table of Contents */
.article-toc {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.article-toc__title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc__list li {
    margin-bottom: 0.5rem;
}

.article-toc__list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    padding: 0.25rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    transition: all 0.3s ease;
}

.article-toc__list a:hover,
.article-toc__list a.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.article-toc__list .toc-h3 {
    padding-left: 1.5rem;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-tags__label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.article-tags a {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-tags a:hover {
    background: var(--primary-color);
    color: white;
}

/* Article Share */
.article-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.article-share__label {
    font-weight: 600;
}

.article-share__buttons {
    display: flex;
    gap: 0.5rem;
}

.article-share__btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.article-share__btn:hover {
    transform: scale(1.1);
}

.article-share__btn--facebook { background: #1877f2; }
.article-share__btn--twitter { background: #1da1f2; }
.article-share__btn--whatsapp { background: #25d366; }
.article-share__btn--telegram { background: #0088cc; }
.article-share__btn--linkedin { background: #0077b5; }
.article-share__btn--copy { background: var(--text-muted); }

/* Article Author Box */
.article-author {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.article-author__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.article-author__info {
    flex: 1;
}

.article-author__name {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.article-author__role {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.article-author__bio {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Related Articles */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-articles__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.related-articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Article Navigation */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.article-nav-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.article-nav-item:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.article-nav-item__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.article-nav-item__title {
    font-weight: 600;
    color: var(--text-primary);
}

.article-nav-item--next {
    text-align: right;
}

/* ===== CONTACT PAGE ===== */
.contact-page {
    padding: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    padding: 2rem;
}

.contact-info__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-info__text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-info__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-info__icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.contact-info__details h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-info__details p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.contact-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.contact-form__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== 404 PAGE ===== */
.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.error-content {
    max-width: 500px;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===== SEARCH RESULTS PAGE ===== */
.search-results {
    padding: 2rem 0;
}

.search-header {
    margin-bottom: 2rem;
}

.search-header__query {
    font-size: 1.75rem;
    font-weight: 700;
}

.search-header__query span {
    color: var(--primary-color);
}

.search-header__count {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.search-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.search-filter {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.search-filter:hover,
.search-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Page Load Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease;
}

/* Stagger Animation */
.stagger-animation > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 991.98px) {
    .category-content,
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .category-sidebar,
    .article-sidebar {
        position: static;
        order: -1;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-articles__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .home-hero__title {
        font-size: 2rem;
    }
    
    .home-hero__subtitle {
        font-size: 1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .article-header__title {
        font-size: 1.75rem;
    }
    
    .article-navigation {
        grid-template-columns: 1fr;
    }
    
    .related-articles__grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-item__number {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .article-author {
        flex-direction: column;
        text-align: center;
    }
    
    .error-code {
        font-size: 5rem;
    }
    
    .error-actions {
        flex-direction: column;
    }
}