/**
 * Time Picker Component Styles
 * Matches application theme (Teal/Cyan primary)
 */

/* Modal Overlay */
.time-picker-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    font-family: 'Sora Variablefont Wght', Arial, sans-serif;
}

.time-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Modal Container */
.time-picker-container {
    position: relative;
    background-color: #ffffff;
    width: 320px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: timePickerFadeIn 0.2s ease-out;
    background-image: url("../../images/bg_noise.webp"), linear-gradient(180deg, #f8f8f7, #f1f0ee);
    background-position: 0 0, 0 0;
    background-size: auto, auto;
    border: 1px solid #dddfe0;
}

@keyframes timePickerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header Section */
.time-picker-header {
    padding: 24px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dddfe0;
}

.time-picker-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-display-value {
    font-size: 48px;
    font-weight: 600;
    color: #95a5a6;
    /* Inactive color */
    cursor: pointer;
    transition: color 0.2s;
}

.time-display-value.active {
    color: #2d8998;
    /* Primary Teal */
}

.time-display-separator {
    font-size: 48px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.time-period-selector {
    display: flex;
    flex-direction: column;
    border: 1px solid #dddfe0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.period-btn {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.period-btn:hover {
    background-color: #f0f7ff;
    color: #2d8998;
}

.period-btn.active {
    background-color: #e0f2f7;
    color: #105c74;
}

/* Clock Face Section */
.time-picker-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.clock-face {
    width: 260px;
    height: 260px;
    background-color: #ffffff;
    /* White background */
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}

.clock-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: #2d8998;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.clock-hand {
    position: absolute;
    /* Radius is 100px. Container is 260px.
       100px / 260px = ~38.5%
       Top = 50% - 38.5% = 11.5% */
    top: 11.54%;
    left: 50%;
    width: 2px;
    height: 38.46%;
    /* Exactly 100px */
    background-color: #2d8998;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through to the face */
    transition: transform 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.clock-hand::after {
    content: '';
    position: absolute;
    top: -16px;
    /* Position the circle at the tip */
    left: 50%;
    width: 32px;
    height: 32px;
    background-color: #2d8998;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: -1;
    /* Behind the number text */
}

/* Clock Numbers */
.clock-number {
    position: absolute;
    width: 32px;
    height: 32px;
    text-align: center;
    line-height: 32px;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Let clicks pass through to the face logic */
    z-index: 6;
    /* Above the hand circle */
    transition: color 0.2s;
}

.clock-number.selected {
    color: #ffffff;
}

.clock-number.small {
    font-size: 13px;
    color: #7f8c8d;
}

.clock-number.small.selected {
    color: #ffffff;
}

/* Footer Section */
.time-picker-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #dddfe0;
    background-color: #ffffff;
}

.time-picker-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: flex-end;
}

.time-action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-action-btn.cancel {
    background: #e5e7eb;
    color: #4a5568;
    border: 1px solid #dddfe0;
}

.time-action-btn.cancel:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.time-action-btn.ok {
    background: #105c74;
    color: white;
}

.time-action-btn.ok:hover {
    background: #0d4a5c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 92, 116, 0.3);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .time-picker-container {
        background-color: #1a1d20;
        background-image: url("../../images/bg_noise.webp"), linear-gradient(180deg, #1a1d20, #0f1113);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .time-picker-header {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    .time-display-separator {
        color: #e5e7eb;
    }

    .time-display-value {
        color: #6b7280;
    }

    .time-display-value.active {
        color: #4fb3c5;
    }

    .time-period-selector {
        border-color: rgba(255, 255, 255, 0.12);
        background: #0f1113;
    }

    .period-btn {
        color: #9ca3af;
    }

    .period-btn:hover {
        background-color: #2a2d30;
        color: #4fb3c5;
    }

    .period-btn.active {
        background-color: rgba(45, 137, 152, 0.2);
        color: #4fb3c5;
    }

    .clock-face {
        background-color: #2a2d30;
    }

    .clock-number {
        color: #e5e7eb;
    }

    .clock-number.selected {
        color: #ffffff;
    }

    .clock-center-dot,
    .clock-hand,
    .clock-hand::after {
        background-color: #2d8998;
    }

    .time-picker-footer {
        border-top-color: rgba(255, 255, 255, 0.12);
    }

    .time-action-btn.cancel {
        background: #2a2d30;
        color: #e5e7eb;
        border-color: rgba(255, 255, 255, 0.12);
    }

    .time-action-btn.cancel:hover {
        background: #3a3d40;
    }

    .time-action-btn.ok {
        background: #105c74;
        color: white;
    }

    .time-action-btn.ok:hover {
        background: #0d4a5c;
    }
}