/* AI Tech Chronicle - Clean Light Theme for Easy Reading */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Thai:wght@400;600;700&family=Sarabun:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme Colors */
    --primary-dark: #1a1a1a;
    --primary-text: #2c2c2c;
    --secondary-text: #5a5a5a;
    --accent-color: #c41e3a;
    --accent-hover: #a01830;
    --accent-light: #fff5f5;
    --background-main: #ffffff;
    --background-light: #fafafa;
    --background-cream: #f9f7f4;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow-soft: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.08);
    --font-heading: 'Noto Serif Thai', 'Georgia', serif;
    --font-body: 'Sarabun', 'Arial', sans-serif;
    --line-height-body: 1.8;
    --line-height-heading: 1.3;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-body);
    background: var(--background-cream);
    color: var(--primary-text);
    line-height: var(--line-height-body);
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

/* Masthead - Clean Light Header */
.masthead {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    color: var(--primary-dark);
    text-align: center;
    padding: 50px 20px 40px;
    border-bottom: 3px solid var(--accent-color);
    position: relative;
    box-shadow: 0 2px 15px var(--shadow-soft);
}

.masthead h1 {
    font-family: var(--font-heading);
    font-size: 3.5em;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.masthead .tagline {
    font-size: 1.3em;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--secondary-text);
    font-style: italic;
    margin-bottom: 20px;
}

.masthead .date-weather {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 1em;
    color: var(--secondary-text);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation - Light & Clean */
.nav-bar {
    background: #ffffff;
    border-bottom: 2px solid var(--border-color);
    padding: 18px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-soft);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--primary-text);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
    font-size: 1.05em;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-color);
}

.nav-separator {
    color: var(--border-color);
}

.nav-btn {
    padding: 12px 25px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.nav-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background-main);
    padding: 50px 40px;
    min-height: calc(100vh - 400px);
    box-shadow: 0 0 30px var(--shadow-soft);
}

/* Section Titles */
.section-title {
    font-family: var(--font-heading);
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 18px;
}

.breaking-badge {
    background: var(--accent-color);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.5em;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Carousel - Light & Airy */
.carousel-section {
    margin-bottom: 60px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-soft);
}

.carousel {
    position: relative;
    height: 420px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--background-light);
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

.carousel-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.carousel-content {
    width: 100%;
    padding: 50px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-content:hover {
    box-shadow: 0 8px 24px var(--shadow-medium);
    border-color: var(--accent-color);
}

.carousel-category {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 25px;
    width: fit-content;
}

.carousel-title {
    font-family: var(--font-heading);
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.2;
    color: var(--primary-dark);
}

.carousel-excerpt {
    font-size: 1.15em;
    line-height: 1.7;
    margin-bottom: 30px;
    color: var(--secondary-text);
}

.carousel-meta {
    display: flex;
    gap: 35px;
    font-size: 1em;
    color: var(--secondary-text);
    margin-bottom: 25px;
}

.btn-read-more {
    padding: 14px 35px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    transition: var(--transition-smooth);
}

.btn-read-more:hover {
    background: var(--accent-hover);
    transform: translateX(5px);
}

/* Carousel Controls */
.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-top: 30px;
}

.carousel-btn {
    padding: 12px 28px;
    background: #ffffff;
    color: var(--primary-text);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.carousel-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.carousel-dots {
    display: flex;
    gap: 12px;
}

.carousel-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.carousel-dot.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.2);
}

.carousel-dot:hover {
    border-color: var(--accent-color);
}

/* News Grid - Clean Cards */
.latest-news {
    margin-top: 50px;
}

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

.news-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.news-card:hover {
    box-shadow: 0 8px 20px var(--shadow-medium);
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.news-category {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 15px;
}

.news-title {
    font-family: var(--font-heading);
    font-size: 1.4em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 15px;
    line-height: 1.3;
    transition: color 0.3s;
}

.news-card:hover .news-title {
    color: var(--accent-color);
}

.news-excerpt {
    color: var(--secondary-text);
    font-size: 0.98em;
    margin-bottom: 18px;
    line-height: 1.6;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.88em;
    color: #888;
    border-top: 1px solid var(--border-light);
    padding-top: 15px;
    margin-top: auto;
}

/* Pagination */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.pagination-info {
    font-size: 1em;
    color: var(--secondary-text);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 12px 24px;
    background: white;
    color: var(--primary-text);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: var(--transition-smooth);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

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

.pagination-num {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--primary-text);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: var(--transition-smooth);
}

.pagination-num:hover:not(.active) {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.pagination-num.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.pagination-ellipsis {
    padding: 0 10px;
    color: var(--secondary-text);
    font-size: 1.1em;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination {
        margin-top: 30px;
        padding-top: 20px;
    }

    .pagination-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }

    .pagination-num {
        width: 40px;
        height: 40px;
        font-size: 0.9em;
    }

    .pagination-controls {
        gap: 6px;
    }
}

/* Article Detail Page */
.article-full {
    max-width: 800px;
    margin: 0 auto;
}

.article-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow-soft);
}

.article-header {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 50px;
    border-bottom: 3px solid var(--border-color);
}

.article-header h1 {
    font-family: var(--font-heading);
    font-size: 2.8em;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
    margin-bottom: 25px;
}

.article-meta {
    display: flex;
    gap: 25px;
    color: var(--secondary-text);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.author-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.6em;
}

.article-content {
    padding: 50px;
    font-size: 1.15em;
    line-height: 2;
    color: var(--primary-text);
}

.article-content > p:first-of-type::first-letter {
    font-size: 4.5em;
    float: left;
    line-height: 0.8;
    margin-right: 15px;
    margin-top: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-color);
}

.article-content h1, .article-content h2, .article-content h3 {
    font-family: var(--font-heading);
    margin-top: 35px;
    margin-bottom: 18px;
    color: var(--primary-dark);
}

.article-content h1 { font-size: 2.2em; }
.article-content h2 { font-size: 1.8em; }
.article-content h3 { font-size: 1.4em; }

.article-content p {
    margin-bottom: 22px;
    text-align: justify;
}

.article-content ul, .article-content ol {
    margin-left: 30px;
    margin-bottom: 22px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Markdown Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95em;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.article-content thead {
    background: linear-gradient(135deg, var(--accent-color) 0%, #a01830 100%);
}

.article-content th {
    color: white;
    font-weight: 700;
    text-align: left;
    padding: 15px 18px;
    border-bottom: 3px solid var(--accent-hover);
}

.article-content tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.article-content tbody tr:hover {
    background-color: var(--accent-light);
}

.article-content tbody tr:last-child {
    border-bottom: none;
}

.article-content td {
    padding: 14px 18px;
    color: var(--primary-text);
    vertical-align: top;
}

.article-content td:first-child {
    font-weight: 500;
}

/* Responsive tables */
@media (max-width: 768px) {
    .article-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .article-content th,
    .article-content td {
        padding: 12px 14px;
        font-size: 0.9em;
    }
}

.article-footer {
    background: var(--background-light);
    padding: 30px 50px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.source-info {
    color: var(--secondary-text);
    font-size: 0.95em;
}

.source-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.source-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: var(--primary-text);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Loading & States */
.loading, .no-articles, .error-message {
    text-align: center;
    padding: 80px 40px;
    color: var(--secondary-text);
}

.loading-icon, .no-articles-icon {
    font-size: 5em;
    margin-bottom: 25px;
}

.no-articles h2 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 2em;
}

.hint {
    color: var(--secondary-text);
    font-size: 1.1em;
    font-style: italic;
}

/* Footer - Clean & Light */
footer {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    color: var(--primary-text);
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 3px solid var(--accent-color);
}

footer p {
    margin: 8px 0;
    color: var(--secondary-text);
}

/* Responsive */
@media (max-width: 768px) {
    .masthead h1 {
        font-size: 2.2em;
        letter-spacing: 0.08em;
    }
    
    .masthead .tagline {
        font-size: 1em;
    }
    
    .carousel {
        height: 550px;
    }
    
    .carousel-title {
        font-size: 2em;
    }
    
    .carousel-content {
        padding: 30px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 30px 20px;
    }
    
    .article-header h1 {
        font-size: 2em;
    }
    
    .article-content {
        padding: 30px;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--accent-color);
    color: white;
}

::-moz-selection {
    background: var(--accent-color);
    color: white;
}
