/* Time Picker - Simple alternative interface to time slider */

/* Time Picker Button */
.time-picker-button {
    position: fixed;
    bottom: 200px; /* Above the reset button */
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a3a5f, #0d1c2a);
    border: 2px solid #3a7acc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.time-picker-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(99, 198, 255, 0.5);
}

/* Time Picker Modal */
.time-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.time-picker-modal.show {
    display: flex;
}

.time-picker-window {
    background: linear-gradient(135deg, #1a3a5f, #0d1c2a);
    border: 2px solid #3a7acc;
    border-radius: 15px;
    padding: 25px;
    width: 350px;
    max-width: 90vw;
    max-height: 90vh;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideIn 0.3s ease-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.time-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 198, 255, 0.3);
}

.time-picker-title {
    font-size: 18px;
    font-weight: bold;
    color: #63c6ff;
}

.time-picker-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.time-picker-close:hover {
    color: #fff;
}

/* Form Elements */
.time-picker-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #63c6ff;
    font-weight: 500;
}

.form-group select,
.form-group input {
    background: rgba(13, 28, 42, 0.7);
    border: 2px solid rgba(99, 198, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group select:focus,
.form-group input:focus {
    border-color: rgba(99, 198, 255, 0.6);
}

.form-group select option {
    background-color: #0d1c2a;
    color: white;
}

/* Era Selection */
.era-selection {
    display: flex;
    gap: 10px;
}

.era-button {
    flex: 1;
    background: rgba(13, 28, 42, 0.7);
    border: 2px solid rgba(99, 198, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
}

.era-button:hover {
    border-color: rgba(99, 198, 255, 0.6);
    background: rgba(99, 198, 255, 0.2);
}

.era-button.active {
    background: rgba(99, 198, 255, 0.3);
    border-color: rgba(99, 198, 255, 0.8);
}

/* Period Selection */
.period-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.period-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(99, 198, 255, 0.5);
    border-radius: 4px;
    background: rgba(13, 28, 42, 0.7);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.period-checkbox:checked {
    background: rgba(99, 198, 255, 0.8);
    border-color: #63c6ff;
}

.period-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.period-label {
    font-size: 14px;
    color: white;
    cursor: pointer;
}

/* End Time Section */
.end-time-section {
    display: none;
    padding: 15px;
    background: rgba(99, 198, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(99, 198, 255, 0.3);
    margin-top: 10px;
}

.end-time-section.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.end-time-title {
    font-size: 16px;
    color: #63c6ff;
    margin-bottom: 15px;
    text-align: center;
}

/* Action Buttons */
.time-picker-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.time-picker-button-action {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-picker-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.time-picker-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.time-picker-set {
    background: linear-gradient(135deg, #63c6ff, #3a7acc);
    color: white;
}

.time-picker-set:hover {
    background: linear-gradient(135deg, #7dd3ff, #4a8bdc);
    box-shadow: 0 0 15px rgba(99, 198, 255, 0.4);
}

.time-picker-set:disabled {
    background: rgba(99, 198, 255, 0.3);
    cursor: not-allowed;
}

/* Error Messages */
.error-message {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .time-picker-window {
        width: 95vw;
        max-width: 400px;
        padding: 20px;
        margin: 10px;
        max-height: 85vh;
    }
    
    .time-picker-form {
        gap: 12px;
    }
    
    .form-group select,
    .form-group input {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .time-picker-window {
        width: 95vw;
        padding: 15px;
        max-height: 80vh;
    }
    
    .time-picker-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .era-selection {
        flex-direction: column;
        gap: 8px;
    }
    
    .time-picker-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .time-picker-form {
        gap: 10px;
    }
    
    .form-group {
        gap: 6px;
    }
}

/* Ensure scrolling works properly */
.time-picker-form {
    flex: 1;
    overflow-y: auto;
}

/* Mobile Time Picker Button */
.mobile-time-picker-button {
    position: relative;
    display: none; /* Hidden by default, shown in mobile mode */
    padding: 8px 12px;
    min-width: 90px;
    height: 60px;
    background: linear-gradient(135deg, #1a3a5f, #0d1c2a);
    border: 2px solid #3a7acc;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.3s ease;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
}

.mobile-time-picker-button:hover {
    background: linear-gradient(135deg, #2a4a7f, #1d2c4a);
    box-shadow: 0 0 10px rgba(99, 198, 255, 0.3);
}

.mobile-time-picker-button i {
    font-size: 16px;
    line-height: 1;
}

.mobile-time-display {
    font-size: 9px;
    font-weight: bold;
    color: #63c6ff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    line-height: 1;
}

/* Mobile Time Actions */
.mobile-time-actions {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(13, 28, 42, 0.95);
    border: 1px solid rgba(99, 198, 255, 0.5);
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.mobile-time-actions.show {
    display: flex;
}

.mobile-time-action {
    background: rgba(99, 198, 255, 0.2);
    border: 1px solid rgba(99, 198, 255, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mobile-time-action:hover {
    background: rgba(99, 198, 255, 0.3);
    border-color: rgba(99, 198, 255, 0.6);
}

.mobile-time-action i {
    margin-right: 5px;
    font-size: 14px;
}

/* Controls Container for Mobile */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 0 10px;
}

/* Filters Dropdown */
.filters-dropdown {
    position: relative;
    display: block; /* Show on desktop by default */
}

.filters-dropdown-button {
    background: linear-gradient(135deg, #1a3a5f, #0d1c2a);
    border: 2px solid #3a7acc;
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    touch-action: manipulation;
}

.filters-dropdown-button:hover {
    background: linear-gradient(135deg, #2a4a7f, #1d2c4a);
    box-shadow: 0 0 10px rgba(99, 198, 255, 0.3);
}

.filters-dropdown-button i {
    font-size: 16px;
}

.filters-text {
    font-size: 12px;
    font-weight: 500;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.filters-dropdown-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.filters-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13, 28, 42, 0.95);
    border: 1px solid rgba(99, 198, 255, 0.5);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 1002;
    min-width: 180px;
}

.filters-dropdown-content.show {
    display: flex;
}

.filters-dropdown .filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filters-dropdown .filter-toggle:hover {
    background: rgba(99, 198, 255, 0.1);
}

.filters-dropdown .filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.filter-label {
    color: white;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

/* Desktop-specific styles for filters dropdown */
@media screen and (min-width: 769px) {
    .controls-container {
        padding: 0 15px;
        margin: 15px 0;
        gap: 15px;
    }
    
    .filters-dropdown-button {
        background: linear-gradient(135deg, #2d3a47, #1a232e);
        border: 2px solid rgba(74, 158, 255, 0.3);
        border-radius: 12px;
        padding: 10px 16px;
        color: #e0e0e0;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
        min-width: 130px;
        justify-content: space-between;
    }
    
    .filters-dropdown-button:hover {
        background: linear-gradient(135deg, #3d4a57, #2a333e);
        border-color: rgba(74, 158, 255, 0.5);
        box-shadow: 0 2px 8px rgba(74, 158, 255, 0.2);
        transform: translateY(-1px);
    }
    
    .filters-dropdown-button.active {
        background: linear-gradient(135deg, #4d5a67, #3a434e);
        border-color: rgba(74, 158, 255, 0.7);
        box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    }
    
    .filters-dropdown-content {
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        right: 0;
        background: rgba(25, 35, 45, 0.98);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(74, 158, 255, 0.3);
        border-radius: 8px;
        padding: 12px;
        display: none;
        flex-direction: column;
        gap: 10px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
        z-index: 1002;
        min-width: 200px;
    }
    
    .filters-dropdown .filter-toggle {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid transparent;
    }
    
    .filters-dropdown .filter-toggle:hover {
        background: rgba(74, 158, 255, 0.15);
        border-color: rgba(74, 158, 255, 0.3);
        transform: translateX(2px);
    }
    
    .filters-dropdown .filter-toggle input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin: 0;
        cursor: pointer;
        accent-color: #4a9eff;
    }
    
    .filters-dropdown .filter-label {
        color: #e0e0e0;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        user-select: none;
    }
}
