﻿.calendar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.calendar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.calendar-container {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.calendar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.calendar-close:hover {
    background: rgba(255, 59, 92, 0.2);
    border-color: #ff3b5c;
    transform: rotate(90deg);
}

.calendar-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
}

.calendar-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.calendar-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.date-selector {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-selector h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    gap: 15px;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-month {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-nav-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

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

.calendar-day-label {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day:hover:not(.disabled):not(.past) {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    transform: scale(1.05);
}

.calendar-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.calendar-day.disabled,
.calendar-day.past {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.calendar-day.today {
    border-color: #4ade80;
}

.calendar-day.other-month {
    opacity: 0.2;
}

.time-selector {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-selector h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 10px;
}

.time-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.time-slot .time-label {
    display: block;
}

.time-slot .booked-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff3b5c;
    background: rgba(255, 59, 92, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.time-slot:hover:not(.disabled):not(.booked) {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    transform: scale(1.05);
}

.time-slot.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.time-slot.booked {
    background: rgba(255, 59, 92, 0.1);
    border-color: rgba(255, 59, 92, 0.3);
    color: #ff3b5c;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.time-slot.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.no-date-selected {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.appointment-service-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.appointment-service-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
}

.appointment-service-price {
    font-size: 24px;
    font-weight: 700;
    color: #4ade80;
    margin: 0;
}

.appointment-form {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.appointment-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    grid-column: 1 / -1;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.appointment-summary {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.appointment-summary h4 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.calendar-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-confirm-appointment {
    flex: 1;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-confirm-appointment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.4);
}

.btn-confirm-appointment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel-appointment {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px 30px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-appointment:hover {
    background: rgba(255, 59, 92, 0.2);
    border-color: #ff3b5c;
}

.time-slots::-webkit-scrollbar {
    width: 6px;
}

.time-slots::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.time-slots::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.time-slots::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

.calendar-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.calendar-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@media (max-width: 768px) {
    .calendar-container {
        width: 95%;
        max-height: 95vh;
    }

    .calendar-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .calendar-header {
        padding: 20px;
    }

    .calendar-title {
        font-size: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .time-slots {
        grid-template-columns: 1fr;
    }

    .calendar-actions {
        flex-direction: column;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}