/* ========================================
   CUSTOM.CSS - Styles spécifiques CONFEMEN SPOC
   ======================================== */

/* ========================================
   LOADING / PRELOADER
   ======================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--ds-gray-200);
    border-top-color: var(--ds-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state .empty-icon {
    font-size: 56px;
    color: var(--ds-gray-300);
    margin-bottom: 16px;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--ds-gray-700);
    margin-bottom: 4px;
}

.empty-state p {
    color: var(--ds-gray-400);
    margin-bottom: 16px;
}

/* ========================================
   MODAL
   ======================================== */
.modal-content {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ds-gray-100);
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--ds-gray-100);
}

/* ========================================
   DROPDOWN
   ======================================== */
.dropdown-menu {
    border: none;
    border-radius: var(--bs-border-radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
}

.dropdown-item {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--ds-blue-pale);
    color: var(--ds-blue);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--ds-gray-400);
}

.dropdown-item:hover i {
    color: var(--ds-blue);
}

.dropdown-divider {
    margin: 4px 0;
    border-color: var(--ds-gray-100);
}

/* ========================================
   TABS
   ======================================== */
.nav-tabs {
    border-bottom: 2px solid var(--ds-gray-200);
}

.nav-tabs .nav-link {
    border: none;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--ds-gray-500);
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--ds-blue);
}

.nav-tabs .nav-link.active {
    color: var(--ds-blue);
    border-bottom-color: var(--ds-blue);
    background: transparent;
}

.nav-tabs .nav-link i {
    margin-right: 8px;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination .page-link {
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--ds-gray-600);
    margin: 0 2px;
    transition: var(--transition-fast);
}

.pagination .page-link:hover {
    background: var(--ds-blue-pale);
    color: var(--ds-blue);
}

.pagination .page-item.active .page-link {
    background: var(--ds-blue);
    color: #fff;
}

/* ========================================
   BADGE DE NOTIFICATION
   ======================================== */
.notification-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--ds-red);
    color: #fff;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 16px;
}

/* ========================================
   TOOLTIP
   ======================================== */
.tooltip-inner {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
}

/* ========================================
   POPOVER
   ======================================== */
.popover {
    border: none;
    border-radius: var(--bs-border-radius);
    box-shadow: var(--shadow-lg);
}

.popover-header {
    font-weight: 600;
    border-bottom: 1px solid var(--ds-gray-100);
}

/* ========================================
   CARDS SPECIALES
   ======================================== */
.card-hover {
    transition: var(--transition-base);
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-border-top {
    border-top: 4px solid var(--ds-blue);
}

.card-border-top-success {
    border-top: 4px solid var(--ds-green);
}

.card-border-top-danger {
    border-top: 4px solid var(--ds-red);
}

.card-border-top-purple {
    border-top: 4px solid var(--ds-purple);
}

/* ========================================
   AVATAR GROUP
   ======================================== */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
    object-fit: cover;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

.avatar-group .avatar-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ds-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-gray-600);
    border: 2px solid #fff;
    margin-left: -8px;
}

/* ========================================
   STATUS INDICATOR
   ======================================== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online {
    background: var(--ds-green);
}

.status-dot.away {
    background: var(--ds-orange);
}

.status-dot.busy {
    background: var(--ds-red);
}

.status-dot.offline {
    background: var(--ds-gray-300);
}

/* ========================================
   FORMS - ADDITIONAL
   ======================================== */
.input-group .btn {
    border-radius: 0 10px 10px 0;
}

.input-group .form-control {
    border-radius: 10px 0 0 10px;
}

.form-floating > label {
    padding: 10px 16px;
}

.form-floating > .form-control {
    padding: 10px 16px;
    height: auto;
}

/* ========================================
   RESPONSIVE TABLES
   ======================================== */
.table-responsive {
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

@media (max-width: 768px) {
    .table-responsive {
        border-radius: 0;
    }
}

/* ========================================
   MESSAGE CONTAINER
   ======================================== */
#message-container {
    position: sticky;
    top: 80px;
    z-index: 999;
}

#message-container .alert {
    border-radius: var(--bs-border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
}

/* ========================================
   MISC
   ======================================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}

.transition-all {
    transition: all var(--transition-base);
}

/* ========================================
   DARK THEME SUPPORT
   ======================================== */
body.dark-theme {
    --ds-gray-50: #0F172A;
    --ds-gray-100: #1E293B;
    --ds-gray-200: #334155;
    --ds-gray-300: #475569;
    --ds-gray-400: #64748B;
    --ds-gray-500: #94A3B8;
    --ds-gray-600: #CBD5E1;
    --ds-gray-700: #E2E8F0;
    --ds-gray-800: #F1F4F9;
    --ds-gray-900: #F8FAFC;
    
    --ds-blue-pale: rgba(77, 107, 254, 0.12);
    --bs-body-bg: var(--ds-gray-50);
    --bs-body-color: var(--ds-gray-700);
    --bs-secondary-bg: var(--ds-gray-100);
    --bs-border-color: var(--ds-gray-200);
    --bs-header-bg: var(--ds-gray-100);
}

body.dark-theme .card,
body.dark-theme .stat-widget,
body.dark-theme .module-card {
    background: var(--ds-gray-100);
}

body.dark-theme .welcome-section {
    background: var(--ds-blue-gradient);
}

body.dark-theme .navbar-brand-box .logo .brand-text {
    color: #fff;
}

body.dark-theme #page-topbar {
    border-bottom-color: var(--ds-gray-200);
}

body.dark-theme .footer {
    background: var(--ds-gray-100);
    border-top-color: var(--ds-gray-200);
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    background: var(--ds-gray-100);
    color: var(--ds-gray-700);
    border-color: var(--ds-gray-200);
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    border-color: var(--ds-blue);
    box-shadow: 0 0 0 4px rgba(77, 107, 254, 0.15);
}

body.dark-theme .notification-item {
    background: var(--ds-gray-100);
    border-color: var(--ds-gray-200);
}

body.dark-theme .notification-item.unread {
    background: rgba(77, 107, 254, 0.1);
    border-color: var(--ds-blue-light);
}