/* ==========================================================================
   APPOINTMENT CARDS, TIME SLOTS & CUSTOM SLOT BUTTONS — Modern Luxury iOS
   Single Responsibility: Card visuals, slot rows, drag states, custom time buttons
   ========================================================================== */

/* Time Slot Row — mobile-first with taller touch targets */
.time-slot-row {
    display: flex;
    align-items: center;
    height: 76px;
    margin: 4px var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.time-label {
    width: 56px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.slot-divider {
    width: 2px;
    height: 42px;
    background: linear-gradient(to bottom, transparent, rgba(148, 163, 184, 0.25), transparent);
    flex-shrink: 0;
}

.slot-action-area {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 6px 8px;
    min-width: 0;
}

/* Empty State Slot — sleek iOS pill button */
.empty-slot-btn {
    width: 100%;
    height: 58px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-spring);
    min-height: var(--touch-target-lg);
}

.empty-slot-btn:active {
    background: rgba(230, 126, 34, 0.12);
    border-color: var(--theme-primary);
    color: var(--theme-primary);
    transform: scale(0.97);
}

/* Desktop hover for empty slots */
@media (min-width: 801px) {
    .empty-slot-btn:hover {
        background: rgba(230, 126, 34, 0.06);
        border-color: var(--theme-primary);
        color: var(--theme-primary);
        transform: scale(1.01) translateY(-1px);
        box-shadow: 0 6px 16px rgba(230, 126, 34, 0.1);
    }

    .time-slot-row {
        height: 72px;
    }
}

/* Drag hover indicator */
.time-slot-row.drag-hover {
    background-color: rgba(230, 126, 34, 0.08) !important;
    border: 2px dashed rgba(230, 126, 34, 0.5) !important;
    animation: dropPulse 1.5s infinite;
}

.time-slot-row.drag-hover .empty-slot-btn {
    border: 2px dashed rgba(230, 126, 34, 0.6) !important;
    background-color: rgba(230, 126, 34, 0.12) !important;
    transform: scale(1.02) translateY(-1px);
    box-shadow: 0 10px 24px rgba(230, 126, 34, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot-row.drag-hover .empty-slot-btn * {
    display: none !important;
}

.time-slot-row.drag-hover .empty-slot-btn::after {
    content: "📥 BURAYA BIRAKIN";
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--theme-primary);
    animation: textPulse 1s infinite ease-in-out;
}

/* Prevent event flickering over specific empty slot child elements when a drag is active */
body.dragging-active .time-label,
body.dragging-active .slot-divider,
body.dragging-active .empty-slot-btn,
body.dragging-active .slot-dragging-text,
body.dragging-active .slot-action-area,
body.dragging-active .appointment-card,
body.dragging-active .appointment-card *,
body.dragging-active .empty-slot-readonly,
body.dragging-active .btn-delete-custom-slot,
body.dragging-active .drag-handle {
    pointer-events: none !important;
}

/* Dynamic State "Taşınıyor..." (Original Slot while dragging) */
.time-slot-row.slot-dragging {
    background-color: rgba(0, 0, 0, 0.02);
}

.time-slot-row.slot-dragging .slot-action-area {
    opacity: 0.4;
}

.slot-dragging-text {
    width: 100%;
    height: 48px;
    border: 1px dashed var(--border-color);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

/* Appointment Card (Draggable) — Luxury iOS Glass Card */
.appointment-card {
    width: 100%;
    min-height: 60px;
    height: auto;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    border: var(--glass-border);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    display: flex;
    padding: 8px 0;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: var(--transition-spring);
    position: relative;
}

.appointment-card * {
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}

.appointment-card:active {
    cursor: grabbing;
    transform: scale(0.97);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

/* Desktop hover for appointment cards */
@media (min-width: 801px) {
    .appointment-card:hover {
        transform: translateY(-2px) scale(1.015);
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
        border-color: rgba(230, 126, 34, 0.35);
        background: var(--white);
    }
}

/* Left accent bar dynamically matching service color */
.appt-accent-bar {
    width: 5px;
    height: 100%;
    border-radius: 4px;
    margin-left: 3px;
}

.appt-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 12px;
    min-width: 0;
}

.appt-customer {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-badge-container {
    display: flex;
    margin-top: 3px;
}

.service-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
}

.drag-handle {
    display: flex;
    align-items: center;
    padding-right: 10px;
    color: rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    min-width: 32px;
    justify-content: center;
}

.drag-handle .material-icons {
    font-size: 18px !important;
}

/* Visual Card feedback during native drag start */
.appointment-card.is-dragging {
    opacity: 0.3;
    border: 1px dashed var(--theme-primary);
}

/* Custom Time Buttons */
.btn-add-custom-time {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
    margin-right: 6px;
    min-width: 36px;
}

.btn-add-custom-time:active {
    background-color: rgba(0, 0, 0, 0.08);
    transform: scale(0.9);
}

.btn-add-custom-time .material-icons-outlined {
    font-size: 20px !important;
}

.btn-delete-custom-slot {
    background: transparent;
    border: none;
    color: #FF7675;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
    margin-left: 6px;
    border: 1px solid rgba(255, 118, 117, 0.15);
    flex-shrink: 0;
}

.btn-delete-custom-slot:active {
    background-color: #FFF5F5;
    color: #D63031;
    transform: scale(0.93);
}

.btn-delete-custom-slot .material-icons-outlined {
    font-size: 18px !important;
}

/* Desktop hover for custom time buttons */
@media (min-width: 801px) {
    .btn-add-custom-time:hover {
        background-color: rgba(0, 0, 0, 0.05);
        color: var(--text-dark);
        transform: scale(1.08);
    }

    .btn-delete-custom-slot:hover {
        background-color: #FFF5F5;
        color: #D63031;
        border-color: rgba(214, 48, 49, 0.2);
        transform: scale(1.05);
    }

    .appointment-card:hover .drag-handle {
        color: rgba(0, 0, 0, 0.3);
    }
}

/* ==========================================================================
   VIP CARD STYLE — Luxurious Groom Shaving (Damat Tıraşı) Visual Design
   ========================================================================== */

.vip-card {
    background: linear-gradient(-45deg, #FFFDF0, #FFF5CC, #FFEBA3, #FFFBEB) !important;
    background-size: 400% 400% !important;
    animation: goldDrift 10s ease infinite, vipPulse 2.5s ease-in-out infinite alternate !important;
    border: 2px solid #D4AF37 !important; /* Premium Metallic Gold border */
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2), 0 0 8px rgba(212, 175, 55, 0.1) inset !important;
    position: relative;
    overflow: hidden;
}

.vip-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shimmerGlint 6s infinite ease-in-out;
    pointer-events: none;
}

.vip-card:hover {
    transform: translateY(-4px) scale(1.03) !important;
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.4), 0 0 12px rgba(212, 175, 55, 0.2) inset !important;
    border-color: #F1C40F !important;
}

/* Luxurious Gold Accent Bar */
.vip-card .appt-accent-bar {
    background: linear-gradient(to bottom, #D4AF37, #AA7C11) !important;
    box-shadow: 1px 0 5px rgba(212, 175, 55, 0.5) !important;
}

/* Bronze/Gold Typography styling */
.vip-card .appt-customer {
    color: #6C521F !important;
    font-weight: 800 !important;
    letter-spacing: 0.4px;
}

/* Royal Crown Prepend */
.vip-card .appt-customer::before {
    content: "👑 ";
    font-size: 13px;
    margin-right: 2px;
}

/* Golden Glossy Badge */
.vip-card .service-badge {
    background: linear-gradient(135deg, #AA7C11, #D4AF37) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 6px rgba(170, 124, 17, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    letter-spacing: 0.8px;
    padding: 3px 8px !important;
    font-size: 9px !important;
}

.vip-card .drag-handle {
    color: #AA7C11 !important;
}

/* VIP Keyframes */
@keyframes goldDrift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes vipPulse {
    0% {
        box-shadow: 0 6px 15px rgba(212, 175, 55, 0.15), 0 0 8px rgba(212, 175, 55, 0.05) inset;
        border-color: #D4AF37 !important;
    }
    100% {
        box-shadow: 0 10px 25px rgba(212, 175, 55, 0.35), 0 0 12px rgba(212, 175, 55, 0.2) inset;
        border-color: #F1C40F !important;
    }
}

@keyframes shimmerGlint {
    0% {
        left: -150%;
    }
    30% {
        left: 150%;
    }
    100% {
        left: 150%;
    }
}

/* ==========================================================================
   MOLA CARD STYLE — Elegant Diagonal Striped Break Slots (Non-blocking)
   ========================================================================== */

.mola-card {
    background: repeating-linear-gradient(
        45deg,
        rgba(235, 240, 245, 0.4),
        rgba(235, 240, 245, 0.4) 10px,
        rgba(220, 225, 230, 0.4) 10px,
        rgba(220, 225, 230, 0.4) 20px
    ) !important;
    border: 1.5px dashed rgba(99, 110, 114, 0.4) !important;
    box-shadow: none !important;
    opacity: 0.8;
}

.mola-card:hover {
    opacity: 1;
    border-color: rgba(99, 110, 114, 0.7) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03) !important;
}

.mola-card .appt-accent-bar {
    background: linear-gradient(to bottom, #7f8c8d, #95a5a6) !important;
    box-shadow: none !important;
}

.mola-card .appt-customer {
    color: #57606f !important;
    font-weight: 600 !important;
    font-style: italic;
}

.mola-card .service-badge {
    background-color: rgba(99, 110, 114, 0.1) !important;
    color: #636e72 !important;
    border: 1px dashed rgba(99, 110, 114, 0.25) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.mola-card .drag-handle {
    color: #95a5a6 !important;
}

/* ==========================================================================
   VIP SERVICE STYLE — Elite Obsidian & Gold Metallic Visual Theme
   ========================================================================== */

.vip-service-card {
    background: linear-gradient(-45deg, #18191A, #2D3436, #0D0E0F, #1F2426) !important;
    background-size: 400% 400% !important;
    animation: goldDrift 10s ease infinite, vipPulse 2.5s ease-in-out infinite alternate !important;
    border: 2px solid #D4AF37 !important; /* Premium Metallic Gold border */
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25), 0 0 10px rgba(212, 175, 55, 0.15) inset !important;
    position: relative;
    overflow: hidden;
}

.vip-service-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shimmerGlint 6s infinite ease-in-out;
    pointer-events: none;
}

.vip-service-card:hover {
    transform: translateY(-4px) scale(1.03) !important;
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.45), 0 0 15px rgba(212, 175, 55, 0.25) inset !important;
    border-color: #F1C40F !important;
}

/* Luxurious Gold Accent Bar */
.vip-service-card .appt-accent-bar {
    background: linear-gradient(to bottom, #D4AF37, #AA7C11) !important;
    box-shadow: 1px 0 5px rgba(212, 175, 55, 0.5) !important;
}

/* Golden Typography styling */
.vip-service-card .appt-customer {
    color: #F1C40F !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
}

/* Royal Star Prepend for VIP */
.vip-service-card .appt-customer::before {
    content: "⭐ ";
    font-size: 13px;
    margin-right: 2px;
}

/* Golden Glossy Badge */
.vip-service-card .service-badge {
    background: linear-gradient(135deg, #AA7C11, #D4AF37) !important;
    color: #111111 !important; /* Gold on Dark theme contrast */
    font-weight: 900 !important;
    box-shadow: 0 2px 6px rgba(170, 124, 17, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    letter-spacing: 0.8px;
    padding: 3px 8px !important;
    font-size: 9px !important;
}

.vip-service-card .drag-handle {
    color: #D4AF37 !important;
}

/* Randevu Notları ve Kişiselleştirme — Dynamic Auto-sizing Full-view Pill on the Right */
.appt-notes-preview {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    background-color: rgba(230, 126, 34, 0.08); /* Warm glowing orange background */
    border: 1px solid rgba(230, 126, 34, 0.15);
    padding: 3.5px 8px;
    border-radius: var(--spacing-sm);
    max-width: 160px;
    margin: auto 6px auto auto; /* Automatically push to the far right next to the drag handle! */
    flex-shrink: 0;
}

.appt-notes-preview .notes-icon {
    font-size: 12px !important;
    color: var(--theme-primary) !important;
    margin-top: 1px;
}

.appt-notes-preview .notes-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--theme-primary) !important;
    white-space: normal; /* Multi-line wrapping */
    word-break: break-word; /* Allow break on long word */
    line-height: 1.3;
}

/* Desktop: wider note pills */
@media (min-width: 801px) {
    .appt-notes-preview {
        max-width: 180px;
    }
}

/* Dark theme appointment card styles */
.dark-theme .appointment-card:not(.vip-card):not(.vip-service-card):not(.mola-card) {
    background: var(--white) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.dark-theme .appointment-card:not(.vip-card):not(.vip-service-card):not(.mola-card):hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
}

.dark-theme .appt-notes-preview {
    background-color: rgba(230, 126, 34, 0.12) !important;
    border-color: rgba(230, 126, 34, 0.25) !important;
}

.dark-theme .appt-notes-preview .notes-icon,
.dark-theme .appt-notes-preview .notes-text {
    color: #FF9F43 !important; /* Glow orange in dark mode */
}

/* ==========================================================================
   DARK THEME VIP SPECIFIC SURFACES
   ========================================================================== */

/* Damat Tıraşı (.vip-card) — Golden Dark Velvet Concept */
.dark-theme .vip-card {
    background: linear-gradient(-45deg, #2D240E, #4A3E1D, #2D240E, #1C1506) !important;
    border-color: #F1C40F !important;
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.25), 0 0 10px rgba(241, 196, 15, 0.15) inset !important;
}

.dark-theme .vip-card .appt-customer {
    color: #F1C40F !important;
}

.dark-theme .vip-card .service-badge {
    background: linear-gradient(135deg, #AA7C11, #D4AF37) !important;
    color: #111111 !important;
}

.dark-theme .vip-card .drag-handle {
    color: #F1C40F !important;
}

/* VIP Hizmet (.vip-service-card) — Obsidian Gold Spark Concept */
.dark-theme .vip-service-card {
    background: linear-gradient(-45deg, #090A0C, #18191B, #020203, #111215) !important;
    border-color: #D4AF37 !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3), 0 0 10px rgba(212, 175, 55, 0.2) inset !important;
}

.dark-theme .vip-service-card .appt-customer {
    color: #D4AF37 !important;
}

.dark-theme .vip-service-card .service-badge {
    background: linear-gradient(135deg, #8A640F, #AA7C11) !important;
    color: #FFFFFF !important;
}

.dark-theme .vip-service-card .drag-handle {
    color: #D4AF37 !important;
}

/* ==========================================================================
   READONLY CARD & SLOT STYLES — For users without edit permission
   ========================================================================== */

/* Readonly appointment cards (other barber's columns for normal barbers) */
.readonly-card {
    cursor: pointer !important;
    opacity: 0.75;
    position: relative;
}

.readonly-card:hover {
    transform: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    opacity: 0.85;
}

.readonly-card:active {
    cursor: pointer !important;
    transform: scale(0.99) !important;
}

/* Lock icon on readonly cards */
.readonly-lock {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Readonly empty slot indicator */
.empty-slot-readonly {
    width: 100%;
    height: 52px;
    border: 1px dashed rgba(0, 0, 0, 0.05);
    background-color: rgba(0, 0, 0, 0.005);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(0, 0, 0, 0.12);
    font-size: 11px;
    font-weight: 500;
    user-select: none;
}

.empty-slot-readonly .material-icons-outlined {
    font-size: 14px !important;
}

.dark-theme .empty-slot-readonly {
    border-color: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.12);
}

.dark-theme .readonly-card {
    opacity: 0.65;
}

.dark-theme .readonly-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}
