/* VDM - Villeneuve-de-Marsan Weather & Time */
/* Mobile-first, clean, modern design */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #e94560;
    --accent-light: #ff6b6b;
    --success: #4ecca3;
    --warning: #ffc107;
    --graph-bar: #4ecca3;
    --graph-bar-high: #e94560;
    --border-color: rgba(255, 255, 255, 0.1);
    --sunrise-bg: #0f3460;
    --sunset-bg: #142847;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #f5f5f5;
        --bg-secondary: #ffffff;
        --bg-card: #ffffff;
        --text-primary: #1a1a2e;
        --text-secondary: #666666;
        --border-color: rgba(0, 0, 0, 0.1);
        --sunrise-bg: #e8e8e8;
        --sunset-bg: #d0d8e8;
    }
}

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 2rem;
}

/* Location Header */
.location-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-left: 0;
}

/* Time Section */
.time-section {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.current-time {
    font-size: 4rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}

.current-date {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: capitalize;
}

/* Section Headers */
h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Sun Section */
.sun-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sun-table,
.weather-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.sun-table th,
.weather-table th {
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.sun-table th:first-child,
.weather-table th:first-child {
    text-align: left;
}

.sun-table td,
.weather-table td {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sun-table tr:last-child td,
.weather-table tr:last-child td {
    border-bottom: none;
}

.row-label {
    text-align: left !important;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Sun Table - Sunrise/Sunset Columns */
.sun-table .day-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sun-table .sub-header th {
    font-size: 0.8rem;
    font-weight: 400;
    padding: 0.5rem 0.25rem;
}

.sun-table .sunrise-header,
.sun-table .sunset-header {
    text-align: center;
}

.sun-table .separator-col {
    width: 8px;
    min-width: 8px;
    padding: 0 !important;
    background: var(--bg-primary);
    border: none !important;
}

.sun-table thead .separator-col {
    border-bottom: none !important;
}

.sun-table .sunrise-col {
    background: var(--sunrise-bg);
    text-align: center;
    padding: 0.6rem 0.4rem;
}

.sun-table .sunset-col {
    background: var(--sunset-bg);
    text-align: center;
    padding: 0.6rem 0.4rem;
}

.sun-table td.separator-col {
    background: var(--bg-primary);
    border-bottom: none;
}

/* Moon Phase Section */
.moon-phase-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.moon-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
}

.moon-icon {
    font-size: 2.5rem;
    line-height: 1;
}

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

.moon-phase-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.moon-illumination {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Weather Section */
.weather-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.current-temp {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
}

.temp-value {
    font-size: 4.5rem;
    font-weight: 200;
    line-height: 1;
}

.temp-unit {
    font-size: 2rem;
    font-weight: 300;
    vertical-align: super;
    color: var(--text-secondary);
}

.weather-condition {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Rain Graph */
.rain-graph-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.rain-graph {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 120px;
}

.graph-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 80px;
    gap: 4px;
    padding: 0 0.25rem;
}

.graph-bar {
    flex: 1;
    background: var(--graph-bar);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    position: relative;
    transition: height 0.3s ease;
}

.graph-bar.high {
    background: var(--graph-bar-high);
}

.graph-bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.graph-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0 0.25rem;
}

.graph-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    flex: 1;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.update-info {
    margin-bottom: 0.25rem;
}

.copyright {
    margin-bottom: 0.75rem;
}

/* Location Selector */
.location-selector {
    margin-top: 0.5rem;
}

.location-dropdown {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.location-dropdown:focus {
    outline: none;
    border-color: var(--accent);
}

.location-dropdown option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Loading/Error States */
.loading {
    opacity: 0.5;
}

.error {
    color: var(--accent);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.updating {
    animation: pulse 1s ease-in-out infinite;
}

/* Responsive adjustments */
@media (min-width: 400px) {
    .current-time {
        font-size: 5rem;
    }
    
    .temp-value {
        font-size: 5.5rem;
    }
}

@media (min-width: 600px) {
    .container {
        padding: 2rem;
    }
    
    .current-time {
        font-size: 6rem;
    }
    
    .sun-table td,
    .weather-table td,
    .sun-table th,
    .weather-table th {
        padding: 1rem;
    }
}

/* High contrast for outdoor visibility */
@media (prefers-contrast: more) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --bg-primary: #000000;
        --bg-secondary: #111111;
        --bg-card: #222222;
    }
}
