/* Optimized Booking Modal Styles */

/* Modal Overlay */
.booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.booking-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content - Optimized Size */
.booking-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    height: auto;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Modal Header - Compact */
.modal-header {
    background: linear-gradient(135deg, #5E2BFF, #C830CC);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body - No Scroll */
.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Compact Booking Layout */
.booking-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    height: 100%;
}

/* Calendar Section - Compact */
.calendar-section {
    display: flex;
    flex-direction: column;
}

.calendar-container-modal {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    flex: 1;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-month-year {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav button {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: #5E2BFF;
    color: white;
    border-color: #5E2BFF;
}

/* Calendar Grid - Compact */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
}

.weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.25rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    min-height: 200px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover:not(.disabled):not(.booked) {
    background: #5E2BFF;
    color: white;
    border-color: #5E2BFF;
}

.calendar-day.today {
    border: 2px solid #5E2BFF;
    font-weight: 700;
}

.calendar-day.selected {
    background: #5E2BFF !important;
    color: white !important;
    font-weight: 600;
}

.calendar-day.booked {
    background: #fca5a5;
    color: #991b1b;
    cursor: not-allowed;
    opacity: 0.6;
}

.calendar-day.disabled {
    background: #f3f4f6;
    color: #d1d5db;
    cursor: not-allowed;
}

/* Legend - Compact */
.calendar-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Robot Selection - Compact */
.robot-selection-compact {
    display: flex;
    flex-direction: column;
}

.robot-selection-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

/* Compact Robot Cards */
.robot-cards-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
    max-height: 220px;
}

.robot-card-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.robot-card-compact:hover {
    background: white;
    border-color: rgba(94, 43, 255, 0.3);
    box-shadow: 0 2px 8px rgba(94, 43, 255, 0.1);
}

.robot-card-compact.selected {
    background: linear-gradient(135deg, rgba(94, 43, 255, 0.08), rgba(200, 48, 204, 0.08));
    border-color: #5E2BFF;
}

.robot-card-compact.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 18px;
    height: 18px;
    background: #5E2BFF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: bold;
}

/* Robot Icon - Smaller */
.robot-icon-compact {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #5E2BFF, #C830CC);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

/* Robot Info */
.robot-info-compact {
    flex: 1;
    min-width: 0;
}

.robot-name-compact {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.robot-price-compact {
    font-size: 0.75rem;
    color: #5E2BFF;
    font-weight: 600;
}

/* Booking Summary - Compact */
.booking-summary-compact {
    margin-top: auto;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(94, 43, 255, 0.05), rgba(200, 48, 204, 0.05));
    border-radius: 10px;
    border: 1px solid rgba(94, 43, 255, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.75rem;
}

.summary-label {
    color: #6b7280;
}

.summary-value {
    color: #1f2937;
    font-weight: 600;
}

.summary-row.total {
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(94, 43, 255, 0.1);
}

.summary-row.total .summary-value {
    font-size: 1.125rem;
    background: linear-gradient(135deg, #5E2BFF, #C830CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Booking Actions - Compact */
.booking-actions {
    margin-top: 0.75rem;
}

.btn-book {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #5E2BFF, #C830CC);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-book:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(94, 43, 255, 0.3);
}

.btn-book:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar Styling */
.robot-cards-compact::-webkit-scrollbar {
    width: 4px;
}

.robot-cards-compact::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.robot-cards-compact::-webkit-scrollbar-thumb {
    background: #5E2BFF;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .booking-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .booking-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .robot-cards-compact {
        max-height: 150px;
    }
    
    .calendar-section {
        order: 2;
    }
    
    .robot-selection-compact {
        order: 1;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .calendar-day {
        font-size: 0.75rem;
    }
}