/*==============================================================
    ATELIER - REZERVAČNÍ SYSTÉM CSS
    Styly pro kalendář, časové bloky a formuláře
==============================================================*/

/* ============================================
   KALENDÁŘ
============================================ */

.calendar-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d81241;
}

.calendar-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    text-align: center;
}

.calendar-header button {
    flex-shrink: 0;
}

.month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d81241;
}

.month-navigation h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

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

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 10px;
    color: #666;
    padding: 5px 2px;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.past {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.calendar-day.past:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.available {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.calendar-day.available:hover {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.calendar-day.partially-booked {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.calendar-day.partially-booked:hover {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

/* Proužek obsazenosti u částečně rezervovaných dnů */
.calendar-day.partially-booked::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #ffc107; /* Výchozí žlutá */
}

/* Dynamické pozadí proužku podle procent */
.calendar-day.partially-booked[data-percentage^="1"]::after,
.calendar-day.partially-booked[data-percentage^="2"]::after,
.calendar-day.partially-booked[data-percentage^="3"]::after {
    background: #ffc107; /* Žlutá pro 10-39% */
}

.calendar-day.partially-booked[data-percentage^="4"]::after,
.calendar-day.partially-booked[data-percentage^="5"]::after {
    background: #ffb300; /* Tmavší žlutá pro 40-59% */
}

.calendar-day.partially-booked[data-percentage^="6"]::after,
.calendar-day.partially-booked[data-percentage^="7"]::after {
    background: #ff9800; /* Oranžová pro 60-79% */
}

.calendar-day.partially-booked[data-percentage^="8"]::after,
.calendar-day.partially-booked[data-percentage^="9"]::after {
    background: #ff5722; /* Červeno-oranžová pro 80-99% */
}

.calendar-day.fully-booked {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    cursor: not-allowed;
}

.calendar-day.fully-booked:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.selected {
    background: #007bff;
    color: #fff;
    border-color: #0056b3;
    font-weight: 700;
}

.calendar-day.today {
    box-shadow: 0 0 0 3px #d81241 inset;
}

/* Legenda */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.legend-color.available {
    background: #d4edda;
}

.legend-color.partially-booked {
    background: #d4edda;
}

.legend-color.fully-booked {
    background: #f8d7da;
}

.legend-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    display: block;
}

/* ============================================
   ČASOVÉ BLOKY
============================================ */

.time-slots-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.time-slot {
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.time-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.time-slot.available {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.time-slot.available:hover {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.time-slot.booked {
    background: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.5;
    text-decoration: line-through;
}

.time-slot.booked:hover {
    transform: none;
    box-shadow: none;
    background: #e9ecef;
}

.time-slot.pending {
    background: #d4edda;
    color: #999;
    border-color: #c3e6cb;
    cursor: pointer;
    position: relative;
}

.time-slot.pending::after {
    content: "Schvaluje se";
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
}

.time-slot.pending:hover {
    background: #c3e6cb;
    color: #777;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.time-slot.selected {
    background: #007bff;
    color: #fff;
    border-color: #0056b3;
}

.time-slot.selected:hover {
    background: #0056b3;
}

/* ============================================
   PŘEHLED VÝBĚRU
============================================ */

.selection-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #dee2e6;
}

.selection-summary h5 {
    color: #1a1a1a;
    font-size: 18px;
    margin-bottom: 15px;
}

.summary-details p {
    margin-bottom: 10px;
    font-size: 15px;
}

.price-display {
    font-size: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #dee2e6;
}

.price-value {
    color: #d81241;
    font-weight: 700;
    font-size: 24px;
}

.discount-code-section {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.discount-code-section label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

#discountMessage {
    font-size: 14px;
}

#discountMessage.success {
    color: #28a745;
}

#discountMessage.error {
    color: #dc3545;
}

.discount-code-section input::placeholder,
.note-section textarea::placeholder,
#clientNote::placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

.note-section {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.note-section label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* ============================================
   FORMULÁŘ REZERVACE
============================================ */

.reservation-form-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.reservation-form-wrapper h4 {
    color: #1a1a1a;
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.form-control {
    border-radius: 8px;
    border: 2px solid #dee2e6;
    padding: 10px 15px;
    font-size: 16px !important; /* Zabránění iOS auto-zoom */
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #d81241;
    box-shadow: 0 0 0 0.2rem rgba(216, 18, 65, 0.15);
}

.reservation-recap {
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.reservation-recap h5 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.reservation-recap p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* ============================================
   CENÍK INFO
============================================ */

.pricing-info-card {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #666;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 25px;
    border: 1px solid #ddd;
}

.pricing-info-card h5 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d81241;
}

.pricing-info-card ul li {
    padding: 8px 0;
    font-size: 14px;
    color: #555;
}

.pricing-info-card hr {
    border-color: rgba(0,0,0,0.1);
    margin: 15px 0;
}

.pricing-info-card a {
    color: #d81241;
    font-weight: 600;
}

.pricing-info-card a:hover {
    color: #b80e35;
}

/* ============================================
   PROFIL UŽIVATELE
============================================ */

.user-profile-card {
    background: linear-gradient(135deg, #d81241 0%, #b80e35 100%);
    color: #fff;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 4px 15px rgba(216, 18, 65, 0.3);
}

.user-profile-card h5 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 5px;
}

.user-profile-card .text-muted {
    color: rgba(255,255,255,0.8) !important;
    font-size: 14px;
}

.user-profile-card .btn-outline-secondary {
    border-color: #fff;
    color: #fff;
}

.user-profile-card .btn-outline-secondary:hover {
    background: #fff;
    color: #d81241;
}

.user-profile-card .badge {
    font-size: 12px;
    padding: 5px 10px;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 991px) {
    .calendar-wrapper {
        position: relative;
        top: 0;
        margin-bottom: 30px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 767px) {
    .calendar-grid {
        gap: 5px;
    }
    
    .calendar-day {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .calendar-day-header {
        font-size: 11px;
        padding: 6px 2px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
    
    .time-slot {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .selection-summary {
        padding: 15px;
    }
    
    .price-display {
        font-size: 16px;
    }
    
    .price-value {
        font-size: 20px;
    }
    
    .reservation-form-wrapper,
    .pricing-info-card {
        padding: 20px;
    }
    
    .month-navigation h5 {
        font-size: 16px;
    }
}

/* ============================================
   MODÁLNÍ OKNA - Historie
============================================ */

.reservation-history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #dee2e6;
    transition: all 0.2s ease;
}

.reservation-history-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left-color: #d81241;
}

.reservation-history-item.status-pending {
    border-left-color: #ffc107;
}

.reservation-history-item.status-confirmed {
    border-left-color: #28a745;
}

.reservation-history-item.status-cancelled {
    border-left-color: #dc3545;
}

.reservation-history-item h6 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.reservation-history-item p {
    margin-bottom: 5px;
    font-size: 14px;
}

.reservation-history-item .badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* ============================================
   ANIMACE A EFEKTY
============================================ */

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   UTILITY CLASSES
============================================ */

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.bg-success-light {
    background-color: #d4edda !important;
}

.bg-danger-light {
    background-color: #f8d7da !important;
}

.bg-warning-light {
    background-color: #fff3cd !important;
}

/* ============================================
   HISTORIE REZERVACÍ
============================================ */

tr.past-reservation {
    opacity: 0.4;
    color: #6c757d;
}

tr.past-reservation td {
    color: #6c757d !important;
}

tr.past-reservation .badge {
    opacity: 0.6;
}

/* ============================================
   PRINT STYLES
============================================ */

@media print {
    .navbar,
    .btn,
    .calendar-wrapper,
    .pricing-info-card {
        display: none !important;
    }
    
    .reservation-recap {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}
