/* ============================================
   Sala de Ședințe – Custom Styles
   ============================================ */

/* General */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar */
.navbar-brand {
    font-size: 1.1rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
}
.card-header {
    border-radius: 12px 12px 0 0 !important;
}

/* FullCalendar Customization */
#calendar {
    min-height: 500px;
}

.fc {
    --fc-border-color: #e2e8f0;
    --fc-today-bg-color: #eff6ff;
    --fc-event-bg-color: #2563eb;
    --fc-event-border-color: #1d4ed8;
}

.fc .fc-toolbar-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.fc .fc-button {
    border-radius: 8px !important;
    font-size: 0.85rem;
    padding: 6px 12px;
    text-transform: capitalize;
}

.fc .fc-button-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

.fc .fc-button-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: #1e40af;
    border-color: #1e40af;
}

.fc .fc-daygrid-day-number {
    font-size: 0.85rem;
    padding: 4px 8px;
}

.fc .fc-event {
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.fc .fc-event:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: #eff6ff;
}

.fc .fc-timegrid-slot {
    height: 2.5em;
}

/* Sloturi ocupate badge */
.occupied-badge {
    display: inline-block;
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Toast custom */
.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
}
.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* Lista „Următoarele rezervări" */
.upcoming-item:hover {
    background-color: #f8fafc;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

/* Admin table */
.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

/* Dashboard cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info {
    border-radius: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .fc .fc-toolbar-title {
        font-size: 1rem;
    }
    .fc .fc-button {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    #calendar {
        min-height: 350px;
    }
    .table {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    .modal-dialog {
        margin: 10px;
    }
}

/* Form controls focus */
.form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}
.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Smooth transitions */
.card, .btn, .form-control {
    transition: all 0.2s ease;
}

/* Badge primary subtle fallback (older Bootstrap) */
.bg-primary-subtle {
    background-color: #dbeafe !important;
}
.text-primary {
    color: #2563eb !important;
}

/* ============================================
   Room Badges & Legend
   ============================================ */
.room-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.room-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    cursor: default;
}
.room-badge i {
    font-size: 0.85rem;
}

/* Room stat cards in admin */
.room-stat-card {
    border-left: 4px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    background: #fff;
    transition: transform 0.15s ease;
}
.room-stat-card:hover {
    transform: translateY(-2px);
}

/* ============================================
   Tom Select Overrides
   ============================================ */
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    border-radius: 8px;
    border-color: #dee2e6;
    padding: 6px 10px;
    min-height: 38px;
    font-size: 0.9rem;
}
.ts-wrapper.single .ts-control:focus,
.ts-wrapper.multi .ts-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}
.ts-dropdown {
    border-radius: 8px;
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}
.ts-dropdown .option.active {
    background-color: #2563eb;
}
.ts-wrapper.multi .ts-control > .item {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.82rem;
}
.ts-wrapper.multi .ts-control > .item .remove {
    border-left: 1px solid #93c5fd;
    color: #1e40af;
}

/* ============================================
   Interval Repeater
   ============================================ */
.interval-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    position: relative;
    transition: box-shadow 0.15s ease;
}
.interval-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.interval-row .btn-remove-interval {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* ============================================
   Occupied Slots – Room Colors
   ============================================ */
.occupied-badge[data-room-color] {
    border-left: 3px solid currentColor;
}

/* ============================================
   Identity System
   ============================================ */
#navIdentity {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
#btnChangeIdentity {
    font-size: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
#btnChangeIdentity:hover {
    opacity: 1;
}
#resOrgDisplay {
    background-color: #f8f9fa;
    cursor: default;
}
.identity-otp-panel {
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
    border-radius: 12px;
    padding: 16px;
}
.identity-otp-input {
    letter-spacing: 0.45rem;
    text-align: center;
    font-weight: 700;
}
.identity-otp-input::placeholder {
    letter-spacing: 0.45rem;
}
.identity-otp-header .badge {
    min-width: 74px;
    font-size: 0.85rem;
}

/* Identity Modal Dialog Sizing */
#modalIdentity .modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#modalIdentity .modal-header {
    flex-shrink: 0;
    padding: 20px;
}
#modalIdentity .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 30px;
    min-height: 0;
}
#modalIdentity .ts-control {
    border-radius: 8px;
    margin-bottom: 0;
    border: 1px solid #ddd;
}
#modalIdentity .ts-dropdown {
    max-height: 500px !important;
    z-index: 2000 !important;
    width: 100%;
    overflow-y: auto;
}
#modalIdentity .ts-dropdown-content {
    max-height: 480px;
}
/* Tom Select item height */
#modalIdentity .ts-option {
    padding: 12px 15px;
    font-size: 15px;
}
#modalIdentity .ts-option.selected {
    background-color: #0d6efd;
}
/* Ensure select fits well */
#modalIdentity select {
    width: 100%;
}

/* ============================================
   FullCalendar Custom Event Rendering
   ============================================ */
.fc-custom-evt {
    overflow: hidden;
    line-height: 1.35;
    padding: 1px 2px;
    font-size: 0.78rem;
}
.fc-custom-time {
    font-weight: 700;
    white-space: nowrap;
}
.fc-custom-title {
    opacity: 0.92;
}
/* Month view: event slots need a bit more room */
.fc-daygrid-event .fc-custom-evt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Week/Day view: allow multiline */
.fc-timegrid-event .fc-custom-evt {
    white-space: normal;
}

/* ============================================
   Per-Interval RSVP Matrix
   ============================================ */
.table .bi-check-circle-fill { font-size: 1.1rem; }
.table .bi-x-circle-fill { font-size: 1.1rem; }
.table .bi-hourglass { font-size: 1rem; }
}

/* ============================================
   RSVP Badges
   ============================================ */
.rsvp-confirmed {
    color: #059669;
}
.rsvp-declined {
    color: #dc2626;
}
.rsvp-pending {
    color: #d97706;
}

/* ============================================
   Sidebar upcoming – room border
   ============================================ */
.upcoming-item[style*="border-left"] {
    padding-left: 12px;
}

/* ============================================
   Admin Reservation Table Room Badge
   ============================================ */
.table .room-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

/* ============================================
   Reservation Modal – scrollable form fix
   <form> wraps modal-body+footer, so it must
   behave as a flex child+container itself.
   ============================================ */
#modalReservation .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#modalReservation .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 65vh;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
