/**
 * ============================================
 * KALENDAR 2.0 - MODERNE VIZUELNE TRANSFORMACIJE
 * ============================================
 * 
 * Features:
 * - Gradient rezervacije umesto ravnih boja
 * - Glass hover kartice sa svim detaljima
 * - Status ikonice (plaćeno, čišćenje, nepročitano)
 * - Smooth animacije i transitions
 * 
 * Verzija: 2.0
 */

/* ===== MODERNA TABELA KALENDARA ===== */
.calendar-grid table {
    border-collapse: separate !important;
    border-spacing: 4px;
    overflow: visible !important;
}

.calendar-grid {
    overflow-x: auto;
    overflow-y: visible !important;
}

.calendar-grid th {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    font-weight: 700;
    padding: 12px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calendar-grid td {
    border: none !important;
    border-radius: 8px;
    position: relative;
    overflow: visible !important;
    padding: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Povećaj z-index na hover */
.cell-occupied-start:hover,
.cell-occupied-middle:hover,
.cell-occupied-end:hover {
    z-index: 10000 !important;
    position: relative;
}

/* ===== PRAZNE ĆELIJE ===== */
.cell-empty {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cell-empty:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34,197,94,0.2);
}

/* ===== ZAUZETE ĆELIJE (MODERNE GRADIENTS) ===== */
.cell-occupied-start,
.cell-occupied-middle,
.cell-occupied-end {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    cursor: pointer !important;
    position: relative;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cell-occupied-start {
    border-radius: 10px 0 0 10px !important;
}

.cell-occupied-end {
    border-radius: 0 10px 10px 0 !important;
}

.cell-occupied-start.cell-occupied-end {
    border-radius: 10px !important;
}

.cell-occupied-start:hover,
.cell-occupied-middle:hover,
.cell-occupied-end:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

/* ===== STATUS IKONICE ===== */
.cell-occupied-start::before,
.cell-occupied-middle::before,
.cell-occupied-end::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Status: Plaćeno (zelena tackica) */
.cell-occupied-start[data-paid="true"]::before,
.cell-occupied-middle[data-paid="true"]::before,
.cell-occupied-end[data-paid="true"]::before {
    background: radial-gradient(circle, #10b981 0%, #059669 100%);
}

/* Status: Nije plaćeno (crvena tackica) */
.cell-occupied-start[data-paid="false"]::before,
.cell-occupied-middle[data-paid="false"]::before,
.cell-occupied-end[data-paid="false"]::before {
    background: radial-gradient(circle, #ef4444 0%, #dc2626 100%);
}

/* Status: Čišćenje potrebno (žuta tackica) */
.cell-occupied-start[data-cleaning="true"]::after,
.cell-occupied-middle[data-cleaning="true"]::after,
.cell-occupied-end[data-cleaning="true"]::after {
    content: '🧹';
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 10px;
    z-index: 10;
}

/* ===== GLASS HOVER KARTICA ===== */
.reservation-glass-card {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    
    min-width: 280px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.25),
        0 0 0 1px rgba(0,0,0,0.1);
    
    z-index: 99999 !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cell-occupied-start:hover .reservation-glass-card,
.cell-occupied-middle:hover .reservation-glass-card,
.cell-occupied-end:hover .reservation-glass-card {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
    z-index: 99999 !important;
}

.glass-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.glass-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.glass-card-name {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
}

.glass-card-room {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.glass-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.glass-card-icon {
    font-size: 14px;
    width: 18px;
}

.glass-card-label {
    color: #6b7280;
    font-weight: 500;
}

.glass-card-value {
    color: #111827;
    font-weight: 600;
    margin-left: auto;
}

.glass-card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.glass-card-status.paid {
    background: #d1fae5;
    color: #059669;
}

.glass-card-status.unpaid {
    background: #fee2e2;
    color: #dc2626;
}

.glass-card-notes {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* ===== VIKEND I DANAS HIGHLIGHT ===== */
.calendar-grid .weekend {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.calendar-grid .today {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 0 0 2px #3b82f6;
}

/* ===== ANIMACIJA UČITAVANJA ===== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(16,185,129,0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(16,185,129,0.6);
    }
}

.cell-occupied-start,
.cell-occupied-middle,
.cell-occupied-end {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Zaustavi animaciju na hover */
.cell-occupied-start:hover,
.cell-occupied-middle:hover,
.cell-occupied-end:hover {
    animation: none;
}

/* ===== RESPONSIVNOST ===== */
@media (max-width: 768px) {
    .reservation-glass-card {
        min-width: 220px;
        padding: 12px;
    }
    
    .glass-card-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

