/* CALENDAR FLYOUT */
#calendar-flyout {
    position: absolute;
    bottom: 48px;
    right: 0;
    width: 360px;
    background: var(--flyout-bg);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    z-index: 998;
    box-shadow: -5px -5px 20px rgba(0,0,0,0.5);
    transform-origin: bottom right;
    transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.2s;
    overflow: hidden;
    max-height: 90vh;
}

#calendar-flyout.hidden {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

.cal-top {
    padding: 20px;
    background: var(--active-bg);
}

#cal-full-date {
    font-size: 1.5rem;
    font-weight: 300;
}

.cal-body {
    padding: 20px;
    flex: 1;
}

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#cal-month-year {
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.cal-nav-btns {
    display: flex;
    gap: 5px;
}

.cal-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    font-size: 0.8rem;
}

.cal-btn:hover {
    background: var(--hover-bg);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.cal-day-header {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-bottom: 10px;
    font-weight: 600;
}

.cal-day {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 0.9rem;
    margin: 0 auto;
}

.cal-day:hover {
    background: var(--hover-bg);
}

.cal-day.other-month {
    color: var(--text-secondary);
    opacity: 0.5;
}

.cal-day.today {
    background: var(--win-blue);
    color: white !important;
    font-weight: bold;
}

.cal-day.selected {
    border: 2px solid var(--win-blue);
}

/* Footer Timer Style */
.cal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0,0,0,0.2);
}

.cal-timer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 5px;
}

.cal-timer-val {
    font-size: 0.9rem;
    font-weight: 500;
}

.cal-timer-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}
.cal-timer-btn:hover { background: rgba(255,255,255,0.1); border-radius: 4px; }

.cal-focus-btn {
    background: var(--win-blue);
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

.cal-focus-btn:hover {
    filter: brightness(1.1);
}

/* QUICK SETTINGS FLYOUT */
#quick-settings-flyout {
    position: absolute;
    bottom: 48px;
    right: 0;
    width: 380px;
    background: var(--flyout-bg);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    z-index: 998;
    box-shadow: -5px -5px 20px rgba(0,0,0,0.5);
    transform-origin: bottom right;
    transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.2s;
}

#quick-settings-flyout.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

/* Grid */
.qs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* W10 usually has 4 per row in expanded view, or 3 depending on density */
    gap: 4px;
}

.qs-tile {
    background: var(--input-bg);
    border-radius: 0;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s;
    border: 1px solid transparent;
}

.qs-tile:hover {
    background: var(--hover-bg);
    border: 2px solid var(--border-color);
}

.qs-tile:active {
    background: var(--active-bg);
}

.qs-tile.active {
    background: var(--win-blue);
    color: white !important; /* Active tiles are always blue with white text */
    border-color: transparent;
}

.qs-tile.active:hover {
    background: var(--win-blue);
    filter: brightness(1.1);
    border: 2px solid rgba(255,255,255,0.4);
}

/* Force icon white in active tiles */
.qs-tile.active .qs-icon {
    color: white; 
}

.qs-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 8px;
}

.qs-label {
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.1;
}

/* Sliders */
.qs-sliders {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-bottom: 5px;
}

.qs-slider-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qs-slider-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* Win 10 Style Slider */
.qs-range {
    flex: 1;
    -webkit-appearance: none;
    height: 2px;
    background: #666;
    border-radius: 0;
    outline: none;
    cursor: pointer;
}

.qs-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 20px;
    background: var(--win-blue);
    border: none;
    border-radius: 0;
    cursor: pointer;
    margin-top: -9px;
}

.qs-range::-webkit-slider-thumb:hover {
    background: white;
}

.qs-range::-webkit-slider-runnable-track {
    height: 2px;
    background: #666;
    border-radius: 0;
}

/* Footer */
.qs-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qs-battery-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
}

.qs-settings-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.qs-settings-btn:hover {
    background: rgba(255,255,255,0.1);
}