/**
 * Shared Date/Time Picker Component Styles
 * 
 * Professional, modern date and hour picker with drag scrolling
 * 
 * Used by:
 * - medycyna_sanitarne_register_form block
 * - Renewal flow
 */

.datetime-picker-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    user-select: none;
}

.date-picker-section,
.hour-picker-section {
    margin-bottom: 20px;
}

.picker-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fb;
    border: 1px solid #e1e5e9;
}

.picker-scroll-track {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    cursor: grab;
    /* Mobile performance optimizations */
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    transform: translateZ(0);
}

.picker-scroll-track.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.picker-scroll-track::-webkit-scrollbar {
    display: none;
}

.date-item,
.hour-item {
    flex-shrink: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    min-width: 70px;
    text-align: center;
    /* Hardware acceleration for smooth animations */
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.date-item {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.availability-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.availability-indicator.indicator-yellow {
    background-color:rgb(245, 241, 11);
    box-shadow: 0 0 0 2px rgba(248, 195, 20, 0.2);
}

.availability-indicator.indicator-orange {
    background-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.availability-indicator.indicator-green {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.date-item.selected .availability-indicator {
    border-color: rgba(255, 255, 255, 0.6);
}

.hour-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.hour-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.date-display {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.day-name {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hour-display {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.date-item:hover,
.hour-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.date-item.selected,
.hour-item.selected {
    background: linear-gradient(135deg, #19b2ad 0%, #168a85 100%);
    border-color: #19b2ad;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 178, 173, 0.3);
}

.date-item.selected .date-display,
.date-item.selected .day-name,
.hour-item.selected .hour-display {
    color: white;
}

.date-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.date-item.disabled:hover {
    transform: none;
    background: #f9fafb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Navigation Elements */
.nav-gradient {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-gradient.visible {
    opacity: 1;
}

.nav-gradient-left {
    left: 0;
    background: linear-gradient(90deg, 
        rgba(248, 249, 251, 0.95) 0%, 
        rgba(248, 249, 251, 0.8) 40%, 
        rgba(248, 249, 251, 0.4) 80%, 
        transparent 100%);
}

.nav-gradient-right {
    right: 0;
    background: linear-gradient(270deg, 
        rgba(248, 249, 251, 0.95) 0%, 
        rgba(248, 249, 251, 0.8) 40%, 
        rgba(248, 249, 251, 0.4) 80%, 
        transparent 100%);
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    pointer-events: all;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #374151;
    font-size: 14px;
}

.nav-button-left {
    left: 12px;
}

.nav-button-right {
    right: 12px;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #19b2ad;
}

/* Availability Legend Styles */
.availability-legend {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 12px;
    color: #374151;
    margin-top: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.legend-circle.legend-green {
    background-color: #10b981;
}

.legend-circle.legend-yellow {
    background-color: rgb(245, 241, 11);
}

.legend-circle.legend-orange {
    background-color: #f97316;
}

/* Animation for smooth transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hour-picker-section {
    animation: slideIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .date-item,
    .hour-item {
        min-width: 60px;
        padding: 10px 12px;
    }

    .date-display {
        font-size: 13px;
    }

    .day-name {
        font-size: 11px;
    }

    .hour-display {
        font-size: 13px;
    }

    .nav-button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .availability-indicator {
        top: 4px;
        right: 4px;
        width: 7px;
        height: 7px;
    }

    /* Allow parent wrapper to show overflowing navigation elements */
    .datetime-picker-wrapper, 
    .date-time-picker-wrapper {
        overflow: visible !important;
    }

    .date-picker-section,
    .hour-picker-section {
        overflow: visible !important;
    }

    /* Allow overflow for navigation elements to extend outside */
    .picker-container { 
        overflow: visible;
        padding: 0;
    }

    /* Keep gradients inside the scroll track, buttons outside */
    .nav-gradient-left  { 
        left: 0; 
        width: 40px; 
        border-radius: 12px; 
    }
    
    .nav-gradient-right { 
        right: 0; 
        width: 40px; 
        border-radius: 12px; 
    }
    
    .nav-button-left { 
        left: -10px; 
        transform: translate(-50%, -50%); 
    }
    
    .nav-button-right { 
        right: -10px; 
        transform: translate(50%, -50%); 
    }

    /* Slim side paddings to 8 px each → 16 px total */
    .picker-scroll-track { 
        padding: 12px 8px; 
        gap: 8px; 
    }

    /* Ensure cards are properly sized for mobile */
    .date-item,
    .hour-item {
        min-width: 70px; /* Keep original size, don't shrink to 60px */
        padding: 10px 12px;
    }
}

