/* ========================================
   Rawda Available Slots — Redesigned Styles
   ======================================== */

/* Base */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f7f8fa;
}

/* ---- Header ---- */
.header-glass {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ---- Tabs bar ---- */
.tabs-bar {
    background: rgba(247, 248, 250, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Filter tab buttons */
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.filter-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.filter-tab.active {
    background: #fff;
    color: #1f2937;
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.filter-tab.tab-male.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.filter-tab.tab-female.active {
    background: #fdf2f8;
    color: #be185d;
    border-color: #fbcfe8;
}

/* Tab count badges */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.375rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #6b7280;
    transition: all 0.2s ease;
}

.filter-tab.active .tab-count {
    background: #dc2626;
    color: #fff;
}

.filter-tab.tab-male.active .tab-count {
    background: #2563eb;
    color: #fff;
}

.filter-tab.tab-female.active .tab-count {
    background: #db2777;
    color: #fff;
}

/* ---- Section headers (male/female columns) ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.section-header-male {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.section-header-female {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
    box-shadow: 0 2px 10px rgba(219, 39, 119, 0.2);
}

.section-count-badge {
    background: rgba(255, 255, 255, 0.92);
    padding: 0.15rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.section-count-badge.male-badge { color: #1d4ed8; }
.section-count-badge.female-badge { color: #be185d; }

/* ---- Slot cards ---- */
.slot-card {
    background: #fff;
    border-radius: 0.875rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08);
}

.slot-card-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slot-date {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1f2937;
}

.slot-day {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    margin-top: 1px;
}

.slot-card-body {
    padding: 0.625rem 0.75rem;
}

.slot-card-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.6875rem;
    color: #d1d5db;
}

[dir="rtl"] .slot-card-footer {
    text-align: left;
}

/* ---- Timeslot rows ---- */
.ts-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.625rem;
    border-radius: 0.5rem;
    margin-bottom: 0.3rem;
    background: #fafbfc;
    border: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.ts-row:last-child {
    margin-bottom: 0;
}

.ts-row:hover {
    background: #f3f4f6;
}

.ts-time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
    min-width: 4.5rem;
}

/* Progress bar */
.ts-bar-wrap {
    flex: 1;
    height: 0.375rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.ts-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s ease;
}

.ts-bar.green  { background: #22c55e; }
.ts-bar.amber  { background: #f59e0b; }
.ts-bar.red    { background: #ef4444; }

/* Percentage badge */
.ts-pct {
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.ts-pct.green  { background: #dcfce7; color: #15803d; }
.ts-pct.amber  { background: #fef3c7; color: #b45309; }
.ts-pct.red    { background: #fee2e2; color: #dc2626; }

/* Show-all button */
.show-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border: none;
    border-top: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.15s ease;
}

.show-all-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* ---- Pulse dot (auto-refresh indicator) ---- */
.pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50%      { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* ---- Skeleton loading ---- */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Empty state cards ---- */
.empty-state-card {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 2px dashed #e5e7eb;
    border-radius: 0.875rem;
}

.empty-state-card .empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 50%;
    font-size: 1.4rem;
    color: #d1d5db;
}

.empty-state-card .empty-icon.blue  { background: #eff6ff; color: #93c5fd; }
.empty-state-card .empty-icon.pink  { background: #fdf2f8; color: #f9a8d4; }

.empty-state-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.empty-state-card p {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* ---- Fade-in animation (staggered via inline delay) ---- */
.fade-in {
    animation: fadeIn 0.4s ease both;
}

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

/* ---- Responsive grid ---- */
#columnsWrapper {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    #columnsWrapper {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.15s ease;
    padding: 1rem;
}

.modal-content {
    background: #fff;
    border-radius: 1rem;
    max-width: 34rem;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.25s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
    flex-shrink: 0;
}

.modal-body {
    padding: 0.75rem 1.25rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

/* Legend inside modal */
.legend {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    font-size: 0.6875rem;
    color: #6b7280;
    border: 1px solid #f3f4f6;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- Utility: active scale ---- */
button:active {
    transition-duration: 0.1s;
}

/* ---- Print ---- */
@media print {
    .header-glass,
    .tabs-bar,
    footer { display: none; }

    body { background: #fff; }

    .slot-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
