/* Основные стили календаря */
.calendar-section {
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
    position: relative;
}

.calendar-header h2 {
    color: #333;
    font-size: 28px;
    margin: 0;
    min-width: 160px;
    text-align: center;
}

.month-nav {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.month-nav:hover {
    color: #0066CC;
    transform: scale(1.1);
}

.month-nav:active {
    transform: scale(0.95);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.weekday {
    text-align: center;
    padding: 10px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.calendar-day {
    aspect-ratio: 1;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    font-weight: 500;
}

.calendar-day:hover {
    background: #f0f7ff;
    border-color: #0066CC;
}

.calendar-day.has-bookings {
    background: #e3f2fd;
    border-color: #0066CC;
}

.calendar-day.selected {
    background: #0066CC;
    color: white;
    border-color: #0066CC;
}

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

.calendar-day.empty {
    border: none;
    cursor: default;
}

.booking-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #DC3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-details {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
}

.day-details h3 {
    color: #333;
    margin: 0 0 15px 0;
}

.no-bookings {
    color: #666;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.booking-item-small {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0066CC;
}

.booking-time {
    font-weight: 600;
    color: #0066CC;
    min-width: 60px;
}

.booking-boat {
    font-weight: 500;
    color: #333;
    min-width: 100px;
}

.booking-client {
    color: #666;
    flex: 1;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.status-badge.confirmed {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.paid {
    background: #cce5ff;
    color: #004085;
}

/* Дневной просмотр */
.day-view {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 900px;
}

.day-view-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.back-to-calendar {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.back-to-calendar:hover {
    background: #0066CC;
    color: white;
}

.day-view-header h2 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

/* Временная шкала */
.day-timeline {
    display: flex;
    position: relative;
    height: 800px;
    min-height: 800px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 0 0 auto;
    margin-top: 20px;
}

.time-column {
    width: 80px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    position: sticky;
    left: 0;
    z-index: 3;
    flex-shrink: 0;
}

.time-marker {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    pointer-events: none;
}

.time-label {
    position: absolute;
    left: 5px;
    top: -10px;
    font-size: 12px;
    color: #333;
    background: #f8f9fa;
    padding: 2px 4px;
    z-index: 3;
    font-weight: 500;
}

.time-label.half {
    color: #999;
    font-size: 11px;
}

.time-line {
    position: absolute;
    left: 70px;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.time-line.half {
    background: #f0f0f0;
    border-bottom: 1px dashed #f0f0f0;
}

/* Колонка с бронированиями */
.grid-column {
    flex: 1;
    position: relative;
    background: white;
    min-width: 600px;
}

/* Вертикальные линии для катеров */
.boat-columns {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
    z-index: 1;
}

.boat-column {
    flex: 1;
    height: 100%;
    border-left: 1px solid #f0f0f0;
    position: relative;
}

.boat-column:first-child {
    border-left: none;
}

.boat-column::after {
    content: attr(data-boat);
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 11px;
    color: #999;
    background: rgba(255,255,255,0.9);
    padding: 2px 4px;
    border-radius: 3px;
    pointer-events: none;
}

/* Контейнер для бронирований */
.bookings-container {
    position: relative;
    height: 100%;
    z-index: 2;
}

/* Блоки бронирований */
.booking-block {
    position: absolute;
    padding: 8px;
    border-radius: 6px;
    border-left: 4px solid;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 12px;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 10;
    min-width: 100px;
}

.booking-block:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 20;
}

.booking-time {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 11px;
}

.booking-boat {
    font-weight: 500;
    color: #0066CC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.booking-client {
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

.booking-phone {
    color: #666;
    font-size: 10px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-status {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    background: rgba(255,255,255,0.9);
}

.booking-status.pending { color: #856404; }
.booking-status.confirmed { color: #155724; }
.booking-status.paid { color: #004085; }

/* Сообщение о пустом дне */
.no-bookings-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Модальное окно */
.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid #e8d9c0;
    background: #fff9f0;
    background-image: 
        linear-gradient(45deg, #f5e8d9 1px, transparent 1px),
        linear-gradient(-45deg, #f5e8d9 1px, transparent 1px);
    background-size: 20px 20px;
}

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

.modal-header h2 {
    color: #333;
    font-size: 20px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 24px;
}

.booking-detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #e8d9c0;
}

.booking-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    color: #666;
    font-weight: 500;
}

.detail-value {
    flex: 1;
    color: #333;
    font-weight: 600;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary {
    background: #0066CC;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-outline {
    background: white;
    border: 2px solid #0066CC;
    color: #0066CC;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-outline:hover {
    background: #f0f7ff;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .calendar-section {
        padding: 10px;
    }
    
    .calendar-header h2 {
        font-size: 16px;
    }
    
    .weekday {
        font-size: 11px;
        padding: 5px;
    }
    
    .calendar-day {
        padding: 4px;
        font-size: 11px;
    }
    
    .booking-item-small {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .booking-time {
        min-width: 50px;
    }
    
    .booking-boat {
        min-width: 70px;
    }
    
    .status-badge {
        min-width: 60px;
    }

    .day-view {
        padding: 10px;
    }

    .day-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .day-view-header h2 {
        font-size: 16px;
    }

    .time-column {
        width: 60px;
    }

    .time-label {
        font-size: 10px;
        left: 2px;
        top: -8px;
    }

    .time-label.half {
        font-size: 9px;
    }

    .time-line {
        left: 50px;
    }

    .booking-block {
        padding: 4px;
        font-size: 10px;
    }

    .booking-time {
        font-size: 9px;
    }

    .booking-boat {
        font-size: 10px;
    }

    .booking-client {
        font-size: 9px;
    }

    .booking-phone {
        display: none;
    }

    .booking-status {
        font-size: 8px;
        padding: 1px 3px;
    }
}