@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Light Theme (Mint & Cyan) */
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(16, 185, 129, 0.12);
    --text-primary: #062f29;
    --text-secondary: #2c4a44;
    --text-muted: #64827d;
    --accent-primary: #10b981; /* Emerald */
    --accent-secondary: #06b6d4; /* Cyan */
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --card-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.08), 0 1px 3px rgba(0, 0, 0, 0.01);
    --ring-color: rgba(16, 185, 129, 0.15);
    --success: #10b981;
    --error: #ef4444;
    --border-range-track: #d1fae5;
}

[data-theme="dark"] {
    /* Dark Theme (Deep Forest & Teal Black) */
    --bg-primary: #04100e;
    --bg-secondary: #081a17;
    --bg-glass: rgba(8, 26, 23, 0.75);
    --border-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #e6f4f1;
    --text-secondary: #97b0ab;
    --text-muted: #536d69;
    --accent-primary: #34d399; /* Bright Mint */
    --accent-secondary: #22d3ee; /* Electric Cyan */
    --accent-gradient: linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(255, 255, 255, 0.01);
    --ring-color: rgba(52, 211, 153, 0.15);
    --border-range-track: #0e302a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

html, body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Gradients/Glows */
.glow-bg {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.04) 50%, rgba(0,0,0,0) 100%);
    top: -100px;
    left: -100px;
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

.glow-bg-secondary {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, rgba(16, 185, 129, 0.03) 50%, rgba(0,0,0,0) 100%);
    bottom: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Glassmorphism Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-theme {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    box-shadow: var(--card-shadow);
}

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

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

/* Hero Section */
.hero {
    padding: 5rem 0 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

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

/* Tools Grid */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.tool-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tool-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Featured Articles Grid */
.articles-section {
    padding: 5rem 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.article-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: auto;
}

/* Footer Section */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-glass);
    padding: 4rem 0 2rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 320px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-glass);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive Menu */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .logo {
        margin-right: auto;
    }
    
    .menu-toggle {
        display: block;
        margin-right: 0.75rem;
    }
    
    .section-title {
        justify-content: center;
        text-align: center;
        font-size: 1.6rem;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border-glass);
        box-shadow: var(--card-shadow);
    }
    
    nav.active {
        display: flex;
    }
    
    .glass-card {
        padding: 1.25rem;
    }
}

/* Calculator Layout Styles */
.calculator-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

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

.input-section, .results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header span {
    font-weight: 600;
    color: var(--text-secondary);
}

.slider-value-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-input-text {
    width: 120px;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    text-align: right;
}

.slider-input-text:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.custom-range {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 15px 0;
    outline: none;
}

/* Track styling for Chrome/Safari/Edge */
.custom-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--border-range-track);
    border-radius: 4px;
    border: none;
}

/* Thumb styling for Chrome/Safari/Edge */
.custom-range::-webkit-slider-thumb {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-secondary);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-secondary);
    box-shadow: 0 3px 12px rgba(6, 182, 212, 0.6);
}

/* Firefox Track */
.custom-range::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--border-range-track);
    border-radius: 4px;
}

/* Firefox Thumb */
.custom-range::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-secondary);
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s ease;
}

.custom-range::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.results-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
}

.result-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-card h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.chart-container {
    position: relative;
    margin: auto;
    width: 100%;
    max-width: 280px;
    height: 280px;
}

/* Dynamic Schedule Table Styles */
.table-section {
    margin-top: 3rem;
}

.table-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background: rgba(16, 185, 129, 0.02);
    color: var(--text-primary);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

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

.page-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.page-btn.disabled {
    pointer-events: none;
    opacity: 0.4;
}

/* Page Layout Components */
.page-hero {
    padding: 3rem 0;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.page-content {
    margin-bottom: 5rem;
}

/* Rich Text Content Styles (For Articles) */
.rich-text {
    padding: 3rem;
}

@media (max-width: 768px) {
    .rich-text {
        padding: 1.5rem;
    }
}

.rich-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem 0;
    color: var(--text-primary);
}

.rich-text h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
}

.rich-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.rich-text ul, .rich-text ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.rich-text li {
    margin-bottom: 0.5rem;
}

.rich-text strong {
    color: var(--text-primary);
    font-weight: 600;
}
