#weather-widget-wrapper {
    --primary-color: #26d0ce;
    --secondary-color: #1a2980;
    --header-gradient: linear-gradient(135deg, #f5ebe0 0%, #d5bdaf 100%);
    --bg-color: #f0f9ff;
    --text-color: #2c3e50;
    --white: #ffffff;
    --holiday-bg: #ffdada; 
    --border-radius: 20px;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    font-family: var(--font-main);
    background-color: var(--bg-color);
    padding: 10px; 
    border-radius: var(--border-radius);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Mode Pantalla Completa */
#weather-widget-wrapper.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    padding: 20px;
}

#weather-widget-wrapper.fullscreen-mode #app-container {
    height: auto;
    min-height: 95vh;
}

#app-container {
    background: var(--white);
    width: 100%;
    max-width: 100%; 
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 85vh; 
}

#weather-widget-wrapper header {
    background: var(--header-gradient);
    color: #5e503f;
    padding: 10px 5px; /* Una mica més d'espai vertical */
    text-align: center;
    flex-shrink: 0;
    position: relative; /* IMPORTANT: Per poder posar el botó absolut */
}

/* --- ESTIL DEL NOU BOTÓ A LA CAPÇALERA --- */
.header-fs-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%); /* Centrat verticalment respecte el header */
    background: transparent; /* Transparent perquè es vegi el gradient */
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #5e503f; /* Mateix color que el títol */
    padding: 5px;
    line-height: 1;
    transition: transform 0.2s;
}

.header-fs-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

#weather-widget-wrapper h1 { 
    margin: 0; 
    font-size: 2.2rem; 
    font-weight: 800; 
    color: #5e503f; 
    line-height: 1.1; 
} 

.current-month { 
    font-size: 1.4rem; 
    font-weight: 800; 
    margin-top: 2px; 
    text-transform: uppercase; 
    color: #7f5539;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    justify-content: center; /* TORNAR A CENTRAR ELS BOTONS */
    align-items: center;
    padding: 15px 10px; 
    flex-wrap: wrap;
    gap: 20px; /* Una mica més d'espai entre fletxes i toggle */
    margin-bottom: 10px; 
    flex-shrink: 0;
}

.toggle-container {
    display: flex;
    background: #eee;
    border-radius: 30px;
    padding: 3px;
}

.toggle-btn {
    border: none;
    padding: 10px 24px; 
    border-radius: 25px;
    cursor: pointer;
    font-weight: 800; 
    transition: 0.3s;
    background: transparent;
    color: #666;
    font-size: 1rem; 
    white-space: nowrap;
}

.toggle-btn.active {
    background: #1abc9c;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 40px; 
    height: 40px;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555 !important;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0;
    line-height: 1;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #e8e8e8;
}
.nav-btn:active, .nav-btn:focus {
    background: #f0f0f0;
    outline: none;
}

.btn-summary-link {
    background: #6c5ce7;
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px; 
    padding: 10px;
    padding-top: 5px;
}

.calendar-grid.workdays {
    grid-template-columns: repeat(5, 1fr);
}

.day-header {
    text-align: center;
    font-weight: 900;
    color: #2c3e50;
    font-size: 1.1rem; 
    padding-bottom: 5px; 
    margin-bottom: 0;
    text-transform: uppercase;
    line-height: 1;
}

.day-cell {
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    min-height: 110px; 
    padding: 5px;
    box-sizing: border-box;
}

.day-cell:hover {
    border-color: #1abc9c;
    transform: scale(1.02);
    z-index: 2;
}

.day-cell.holiday {
    background-color: var(--holiday-bg);
    border-color: #ffbaba;
}

.day-cell.outing {
    background-color: #fff; 
    border-color: #a7f3d0;
}

.day-cell.empty {
    background: #fcfcfc;
    border: 2px dashed #e0e0e0;
    cursor: default;
    min-height: 110px; 
}

.day-cell.other-month {
    background: #f9f9f9;
    color: #ccc;
    opacity: 0.6;
}

.day-number {
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 1.3rem; 
    font-weight: 900; 
    color: #333; 
    z-index: 10;
}

.day-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1; 
    margin: 0;
    padding: 0;
    padding-top: 15px; 
}

.icon-xl { 
    font-size: 3rem; 
    line-height: 1;
    display: block;
}

.calendar-grid.workdays .icon-xl {
    font-size: 4rem; 
}

.temp-display {
    font-weight: 800;
    color: #222;
    font-size: 1rem; 
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 10px; 
    margin-bottom: 5px;
}

#modal-overlay, #summary-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    padding: 20px;
    backdrop-filter: blur(4px);
    font-family: var(--font-main);
}

#modal, #summary-modal {
    background: white;
    border-radius: var(--border-radius);
    width: 95%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-title, .summary-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #16a085;
    font-weight: 800;
}

.close-summary-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}

.selector-group { margin-bottom: 25px; }

.group-label {
    font-weight: 800;
    display: block;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    border-left: 6px solid #1abc9c;
    padding-left: 12px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    border: 3px solid #eee;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.2s;
    background: #fafafa;
}

.option-item:hover {
    border-color: #b2ebf2;
    background: #f0feff;
}

.option-item.selected {
    border-color: #1abc9c;
    background: #e0f2f1;
    transform: scale(1.05);
}

.option-item span:first-child { font-size: 2.5rem; margin-bottom: 5px; }
.option-item span:last-child { font-size: 0.9rem; font-weight: bold; text-align: center; line-height: 1.1; }

.temp-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 15px;
}

.stepper-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #1abc9c;
    color: white;
    font-size: 1.8rem; 
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; 
    padding-bottom: 5px; 
    line-height: 1; 
}

.temp-value-input {
    font-size: 2.2rem;
    font-weight: bold;
    width: 100px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    padding: 5px;
    color: #333;
}

.modal-footer { display: flex; gap: 15px; margin-top: 25px; }

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-save { background: #1abc9c; color: white; }
.btn-cancel { background: #eee; color: #666; }

.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.stat-box {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #d4eaf7;
}
.stat-val { font-size: 2rem; font-weight: 800; color: #2c3e50; }
.stat-lbl { font-size: 0.9rem; text-transform: uppercase; color: #7f8c8d; font-weight: bold; }

.chart-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.chart-lbl { width: 120px; font-size: 1rem; font-weight: bold; color: #444; }
.chart-bar-bg { flex: 1; background: #eee; height: 24px; border-radius: 12px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: #26d0ce; text-align: right; padding-right: 8px; color: white; font-size: 0.9rem; line-height: 24px; font-weight: bold; }

@media (max-width: 600px) {
    .calendar-grid { gap: 4px; padding: 5px; }
    .icon-xl { font-size: 2.2rem; }
    .calendar-grid.workdays .icon-xl { font-size: 3rem; }
    .day-cell { min-height: 80px; }
    #weather-widget-wrapper h1 { font-size: 1.5rem; }
    .day-header { font-size: 0.8rem; }
    .toggle-btn { font-size: 0.9rem; padding: 6px 12px; }
    .option-grid { grid-template-columns: repeat(3, 1fr); }
    .summary-stats { grid-template-columns: 1fr; }
    .controls { justify-content: space-between; }
    /* Ajustem la posició del botó en mòbil per si de cas */
    .header-fs-btn { right: 10px; } 
}