/* Custom CSS for Sleep Calculator */

/* Screen Reader Only - for SEO content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Time Picker Styles - Modern Design */
.time-picker-container {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 20px;
    padding: 10px;
}

.time-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
}

.time-option,
.time-option-selected {
    padding: 12px 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    border-radius: 12px;
    min-width: 80px;
    text-align: center;
}

.time-option {
    opacity: 0.3;
    transform: scale(0.75);
    filter: blur(1px);
}

.time-option-selected {
    opacity: 1;
    transform: scale(1);
    background: linear-gradient(135deg, rgba(244, 228, 181, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%);
    box-shadow: 0 0 30px rgba(244, 228, 181, 0.3),
                inset 0 0 20px rgba(244, 228, 181, 0.1);
    border: 2px solid rgba(244, 228, 181, 0.3);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Smooth scroll behavior */
.time-picker {
    scroll-behavior: smooth;
}

/* Time picker hover effect */
.time-picker-container:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.time-picker-container:active {
    transform: translateY(0);
}

/* Selection highlight box */
.time-picker-container::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 20px);
    height: 90px;
    border: 2px solid rgba(244, 228, 181, 0.2);
    border-radius: 16px;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(244, 228, 181, 0.05) 50%, 
        transparent 100%);
}

/* Fade effect for top and bottom of time picker */
.time-picker-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    background: linear-gradient(to bottom, 
        rgba(15, 23, 42, 0.9) 0%,
        transparent 25%,
        transparent 75%,
        rgba(15, 23, 42, 0.9) 100%);
    border-radius: 20px;
}

/* Smooth transitions for screen changes */
section {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Button press effect */
button:active {
    transform: scale(0.95);
}

/* Time option card styles */
.time-card {
    transition: all 0.3s ease;
}

.time-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Suggested badge animation */
.suggested-badge {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}


/* Responsive adjustments */
@media (max-width: 640px) {
    .time-picker-container {
        height: 220px;
        padding: 8px;
    }
    
    .time-option,
    .time-option-selected {
        padding: 10px 16px;
        min-width: 70px;
    }
    
    .time-picker-container::after {
        height: 80px;
        width: calc(100% - 16px);
    }
}

@media (min-width: 768px) {
    .time-picker-container {
        height: 260px;
    }
    
    .time-option,
    .time-option-selected {
        padding: 14px 24px;
        min-width: 90px;
    }
    
    .time-picker-container::after {
        height: 100px;
    }
}

/* Add a subtle glow effect on interaction */
.time-picker-container:active .time-option-selected {
    box-shadow: 0 0 40px rgba(244, 228, 181, 0.5),
                inset 0 0 30px rgba(244, 228, 181, 0.15);
    transform: scale(1.02);
}


/* Glass morphism effect enhancement */
.time-picker-container {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Smooth value change animation */
.time-option,
.time-option-selected {
    will-change: transform, opacity;
}

/* Mobile touch feedback */
@media (hover: none) {
    .time-picker-container:active {
        background: rgba(15, 23, 42, 0.95);
    }
    
    .time-picker-container:active .time-option-selected {
        background: linear-gradient(135deg, rgba(244, 228, 181, 0.25) 0%, rgba(251, 191, 36, 0.15) 100%);
    }
}

/* AM/PM Selector Styles - Horizontal Layout Like Competitor */
.ampm-selector {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    align-self: center;
    gap: 0;
    line-height: 1.2;
}

.ampm-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1;
    text-align: left;
    display: block;
}

.ampm-btn:hover {
    color: rgba(255, 255, 255, 0.6);
}

.ampm-btn.ampm-active {
    color: #ffffff;
}

.ampm-btn:active {
    transform: scale(0.95);
}

/* Focus styles for accessibility */
button:focus-visible {
    outline: 2px solid #f4e4b5;
    outline-offset: 4px;
}

.time-picker:focus-visible {
    outline: 2px solid #f4e4b5;
    outline-offset: 2px;
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(244, 228, 181, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 228, 181, 0.7);
}

/* Prevent text selection on interactive elements */
button, .time-picker {
    -webkit-tap-highlight-color: transparent;
}

/* Add subtle backdrop blur effect */
.backdrop-blur-sm {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

