/* Modern CSS Reset & Design System for UF Hoy Chile */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-main: hsl(210, 40%, 98%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-alt: hsl(210, 40%, 96%);
    
    --primary: hsl(243, 75%, 59%);
    --primary-hover: hsl(243, 75%, 50%);
    --primary-light: hsl(243, 75%, 96%);
    
    --text-primary: hsl(222, 47%, 11%);
    --text-secondary: hsl(215, 16%, 37%);
    --text-muted: hsl(215, 16%, 57%);
    
    --success: hsl(150, 84%, 37%);
    --success-light: hsl(150, 84%, 96%);
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 92%, 96%);
    --danger: hsl(0, 84%, 60%);
    --danger-light: hsl(0, 84%, 97%);
    
    --border-color: hsl(214, 32%, 91%);
    --border-hover: hsl(214, 32%, 80%);
    
    /* Layout Tokens */
    --max-width: 1100px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-premium: 0 20px 25px -5px rgba(79, 70, 229, 0.04), 0 8px 10px -6px rgba(79, 70, 229, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-fast);
}

header.scrolled {
    box-shadow: var(--shadow-sm);
    background-color: rgba(255, 255, 255, 0.95);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo span {
    color: var(--primary);
}

.logo svg {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    padding: 40px 0 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

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

/* Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Today's UF Value Highlight Card */
.uf-today-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.uf-today-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    background-color: var(--success-light);
    color: var(--success);
    border-radius: 9999px;
}

.live-badge .pulse {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(0.9); opacity: 1; }
}

.uf-value-container {
    margin: 20px 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.uf-value {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.copy-btn {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.trend-up {
    color: var(--success);
    background-color: var(--success-light);
}

.trend-down {
    color: var(--danger);
    background-color: var(--danger-light);
}

/* Timeline/Slider Container (D-5 to D+5) */
.timeline-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.timeline-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 6px 0 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Custom scrollbars */
.timeline-scroll::-webkit-scrollbar {
    height: 6px;
}
.timeline-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.timeline-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 999px;
}

.timeline-card {
    flex: 0 0 150px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    scroll-snap-align: start;
    transition: var(--transition-normal);
}

.timeline-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.timeline-card.today {
    background-color: var(--primary-light);
    border-color: var(--primary);
    box-shadow: var(--shadow-premium);
    position: relative;
}

.timeline-card.today::after {
    content: 'HOY';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.05em;
}

.timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.timeline-card.today .timeline-date {
    color: var(--primary);
}

.timeline-day {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.timeline-val {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-val.pending {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Calculator Widget */
.calc-card {
    display: flex;
    flex-direction: column;
}

.calc-tabs {
    display: flex;
    background-color: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
}

.calc-tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.calc-tab.active {
    background-color: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.calc-input {
    width: 100%;
    padding: 12px 14px 12px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-card);
    transition: var(--transition-fast);
}

.calc-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-arrow {
    align-self: center;
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* Quick Restriction Widget */
.quick-restrict-card {
    background: linear-gradient(135deg, hsl(243, 75%, 98%) 0%, hsl(210, 40%, 98%) 100%);
    border: 1px dashed var(--primary);
}

.quick-restrict-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.quick-restrict-header svg {
    color: var(--primary);
}

.quick-restrict-status {
    background: var(--bg-card);
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.quick-restrict-digits {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.digit-pill {
    background-color: var(--text-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

/* SEO Content Section */
.seo-content-section {
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.seo-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.rich-article h2 {
    font-size: 1.8rem;
    margin: 30px 0 16px;
}

.rich-article p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.rich-article ul, .rich-article ol {
    margin: 0 0 20px 24px;
    color: var(--text-secondary);
}

.rich-article li {
    margin-bottom: 8px;
}

.rich-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.925rem;
}

.rich-article th, .rich-article td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.rich-article th {
    background-color: var(--bg-alt);
    font-weight: 600;
    color: var(--text-primary);
}

/* Sidebar Ads / Links */
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background-color: var(--bg-alt);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.sidebar-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.sidebar-card ul {
    list-style: none;
}

.sidebar-card li {
    margin-bottom: 10px;
}

.sidebar-card a {
    font-size: 0.95rem;
    font-weight: 500;
    display: block;
}

/* Adsense placeholder */
.adsense-placeholder {
    background-color: var(--bg-alt);
    border: 1px dashed var(--text-muted);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 20px 0;
}

/* FAQ Accordion */
.faq-section {
    padding: 50px 0;
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-icon {
    font-size: 1.25rem;
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Restricción Vehicular Page Styles */
.restrict-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin-top: 30px;
}

.restrict-form-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.restrict-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.restrict-select, .restrict-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.restrict-select:focus, .restrict-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.restrict-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.restrict-btn:hover {
    background-color: var(--primary-hover);
}

.result-card {
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    display: none;
}

.result-card.show {
    display: block;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.result-restricted {
    background-color: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.result-exempt {
    background-color: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.result-info {
    margin-top: 14px;
}

.result-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--text-primary);
    color: var(--bg-main);
    padding: 40px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.footer-col p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

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

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive Styles */
@media (max-width: 900px) {
    .dashboard-grid, .restrict-grid {
        grid-template-columns: 1fr;
    }
    
    .seo-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .uf-value {
        font-size: 2.8rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        flex-direction: column;
        gap: 16px;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .nav-toggle {
        display: block;
    }
}
