/* Reset y variables */
:root {
    --color-background: hsl(210, 40%, 98%);
    --color-foreground: hsl(220, 15%, 20%);
    --color-card: hsl(0, 0%, 100%);
    --color-primary: hsl(210, 100%, 50%);
    --color-secondary: hsl(30, 100%, 60%);
    --color-border: hsl(214, 31%, 91%);
    --color-muted: hsl(215, 16%, 46%);
    
    --gradient-sunrise: linear-gradient(135deg, hsl(330, 100%, 75%), hsl(30, 100%, 70%), hsl(200, 100%, 65%));
    --gradient-day: linear-gradient(135deg, hsl(200, 100%, 60%), hsl(210, 100%, 50%));
    --gradient-sunset: linear-gradient(135deg, hsl(30, 100%, 65%), hsl(320, 80%, 60%), hsl(240, 60%, 50%));
    --gradient-hero: linear-gradient(135deg, hsl(210, 100%, 50%), hsl(30, 100%, 60%));
    
    --shadow-glow: 0 20px 60px -10px hsl(210, 100%, 50%, 0.3);
    --shadow-card: 0 4px 20px -2px hsl(220, 15%, 20%, 0.1);
    
    --radius: 1rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-foreground);
    line-height: 1.6;
}

/* Page Wrapper */
.page-wrapper {
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-hero);
    padding: 5rem 1.5rem;
    text-align: center;
}

.hero-content {
    max-width: 64rem;
    margin: 0 auto;
}

.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    margin-bottom: 1rem;
    color: white;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 48rem;
    margin: 0 auto;
}

/* Calculator Section */
.calculator-section {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

.calculadora-luz-wrapper {
    max-width: 74rem;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* Card Styles */
.card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.form-card {
    padding: 1rem;
     max-width: 100%;
    
}

/* Form Styles */
.form-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--color-foreground);
}

.form-label svg {
    color: var(--color-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) - 0.25rem);
    background: var(--color-background);
    color: var(--color-foreground);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px hsl(210, 100%, 50%, 0.1);
}

.form-help {
    font-size: 0.75rem;
    color: var(--color-muted);
    font-style: italic;
}

/* Button Styles */
.btn-calcular {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--gradient-hero);
    border: none;
    border-radius: calc(var(--radius) - 0.25rem);
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: opacity 0.3s ease;
}

.btn-calcular:hover {
    opacity: 0.9;
}

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

/* Results Section */
.results-section {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

.results-section.hidden {
    display: none;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 1.5rem;
    text-align: center;
}

.results-title span {
    color: var(--color-primary);
    font-weight: 700;
}

/* Timezone Info */
.timezone-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, hsl(210, 100%, 97%) 0%, hsl(210, 100%, 95%) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.timezone-card {
    text-align: center;
    padding: 1rem;
}

.timezone-card h4 {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timezone-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0.5rem 0;
}

.timezone-name {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-family: 'Courier New', monospace;
}

/* Daily Results Container */
#daily-results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Day Card */
.day-card {
    background: var(--color-card);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.day-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.day-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.day-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: capitalize;
    margin: 0 0 0.5rem 0;
}

.day-date {
    font-size: 0.95rem;
    color: var(--color-muted);
    margin: 0;
    text-transform: capitalize;
}

.day-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.day-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-background);
    border-radius: calc(var(--radius) - 0.25rem);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.day-result:hover {
    background: hsl(210, 100%, 98%);
    border-color: var(--color-primary);
}

.day-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.day-result.sunrise .day-icon {
    color: hsl(30, 100%, 50%);
}

.day-result.sunset .day-icon {
    color: hsl(320, 80%, 50%);
}

.day-result.daylight .day-icon {
    color: var(--color-primary);
}

.day-result.noon .day-icon {
    color: hsl(45, 100%, 50%);
}

.day-result > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.day-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-weight: 500;
}

.day-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-foreground);
}

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

.result-card {
    padding: 1.5rem;
}

.result-card.full-width {
    grid-column: 1 / -1;
}

.gradient-sunrise {
    background: var(--gradient-sunrise);
}

.gradient-sunset {
    background: var(--gradient-sunset);
}

.gradient-day {
    background: var(--gradient-day);
}

.result-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-content-wide {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .result-content-wide {
        flex-direction: row;
        justify-content: space-around;
    }
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    color: white;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.result-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
}

/* Features Section */
.features-section {
    max-width: 64rem;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 50%;
}

.feature-icon-primary {
    background: hsl(210, 100%, 50%, 0.1);
    color: var(--color-primary);
}

.feature-icon-secondary {
    background: hsl(30, 100%, 60%, 0.1);
    color: var(--color-secondary);
}

.feature-icon-accent {
    background: hsl(30, 100%, 60%, 0.1);
    color: var(--color-secondary);
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-foreground);
}

.feature-description {
    font-size: 0.875rem;
    color: var(--color-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    min-width: 300px;
    padding: 1rem 1.5rem;
    background: var(--color-card);
    border-radius: calc(var(--radius) - 0.25rem);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid hsl(142, 76%, 36%);
}

.toast.error {
    border-left: 4px solid hsl(0, 84%, 60%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1.5rem;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}



/* --- Estilos para el Panel de Info y Carga Progresiva --- */

.location-info {
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: linear-gradient(135deg, hsl(210, 100%, 97%) 0%, hsl(210, 100%, 95%) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.location-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.location-info-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-weight: 500;
}

.location-info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-foreground);
    word-break: break-word; /* Evita que nombres largos rompan el layout */
}

/* Ocultar el panel */
.location-info.hidden {
    display: none;
}

/* Spinner de carga */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    min-height: 200px;
    width: 100%;
}

.loader-spinner {
    border: 4px solid var(--color-border);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* --- Estilos para Comparación Horaria --- */
.time-comparison {
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    background: hsl(45, 100%, 95%); /* Un color diferente, como amarillo pálido */
    border: 1px solid hsl(45, 100%, 85%);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.95rem;
    color: hsl(45, 50%, 30%);
}

.time-comparison.hidden {
    display: none;
}

.time-comparison strong {
    font-weight: 600;
}

.calculadora-luz-wrapper {
    max-width: 1200px; /* Puedes ajustar entre 600 y 800 según gusto */
    margin: 0 auto;
    padding: 0.5rem 0.5rem 0.5rem;
}