/* css/users.css */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz@14..32&display=swap');

* {
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f4f7fb;
}

/* custom navy/teal palette */
.bg-navy-sidebar { background-color: #0c2538; }
.bg-navy-deep { background-color: #0b1f33; }
.text-teal-logo { color: #5ee0d0; }
.border-teal-light { border-color: #2aa79b33; }

/* hover effect for nav items */
.hover-nav:hover { background-color: #1f4e5e; color: white; }

/* active navigation item */
.active-nav {
    background-color: #1a4450;
    border-left: 4px solid #2aa79b;
}

/* stat card styles */
.stat-card {
    transition: all 0.2s ease;
    border: 1px solid #eef2f6;
    background-color: white;
    border-radius: 0.75rem;
}
.stat-card:hover { box-shadow: 0 8px 20px -8px rgba(18, 79, 86, 0.15); }

/* dashboard background */
.bg-dashboard-bg { background-color: #f4f7fb; }

/* badge styles */
.badge-pending { 
    background-color: #fef9e7; 
    color: #b78103; 
    display: inline-block; 
    padding: 0.2rem 0.6rem; 
    border-radius: 9999px; 
    font-size: 0.65rem; 
    font-weight: 500;
}
.badge-approved { 
    background-color: #e3f7ec; 
    color: #0f7b4b; 
    display: inline-block; 
    padding: 0.2rem 0.6rem; 
    border-radius: 9999px; 
    font-size: 0.65rem; 
    font-weight: 500;
}
.badge-rejected { 
    background-color: #fee2e2; 
    color: #dc2626; 
    display: inline-block; 
    padding: 0.2rem 0.6rem; 
    border-radius: 9999px; 
    font-size: 0.65rem; 
    font-weight: 500;
}

/* role badge styles */
.role-badge-admin {
    background-color: #f3e8ff;
    color: #7e22ce;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}
.role-badge-dean {
    background-color: #dbeafe;
    color: #1d4ed8;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}
.role-badge-depthead {
    background-color: #e0e7ff;
    color: #4338ca;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}
.role-badge-faculty {
    background-color: #dcfce7;
    color: #15803d;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}
.role-badge-evaluator {
    background-color: #f3f4f6;
    color: #4b5563;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* status colors */
.bg-purple-100 { background-color: #f3e8ff; }
.text-purple-700 { color: #7e22ce; }
.bg-blue-100 { background-color: #dbeafe; }
.text-blue-700 { color: #1d4ed8; }
.bg-green-100 { background-color: #dcfce7; }
.text-green-700 { color: #15803d; }
.bg-amber-100 { background-color: #fef3c7; }
.text-amber-700 { color: #b45309; }
.bg-indigo-100 { background-color: #e0e7ff; }
.text-indigo-700 { color: #4338ca; }
.bg-gray-100 { background-color: #f3f4f6; }
.text-gray-700 { color: #374151; }
.bg-red-100 { background-color: #fee2e2; }
.text-red-700 { color: #dc2626; }

/* Heartbeat animation for active users */
.heartbeat-dot {
    width: 8px;
    height: 8px;
    background-color: #15803d;
    border-radius: 50%;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* ============================================ */
/* ACTION BUTTONS - Consistent with Documents & Approvals */
/* ============================================ */

/* View Profile Button - Gray */
.action-pill-view {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 0.3rem 0.85rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.action-pill-view:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}

/* Delete Button - Red */
.action-pill-delete {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    padding: 0.3rem 0.85rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-pill-delete:hover {
    background-color: #fecaca;
}

/* Button active state */
.action-pill-view:active, .action-pill-delete:active {
    transform: scale(0.97);
}

/* table styling */
table { 
    width: 100%; 
    border-collapse: collapse; 
}
th { 
    font-weight: 600; 
    text-align: left; 
    font-size: 0.7rem; 
    color: #6b7280; 
    padding: 0.875rem 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    letter-spacing: 0.3px;
}
td { 
    padding: 0.875rem 1rem; 
    font-size: 0.85rem; 
    border-bottom: 1px solid #f3f4f6; 
    vertical-align: middle;
}
.user-row:hover { 
    background-color: #f9fafb; 
}

/* mobile header spacer */
.mobile-header-spacer { 
    height: 60px; 
    width: 100%; 
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

/* Sidebar - Mobile */
@media (max-width: 768px) {
    .w-72 {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .w-72.open { left: 0; }
    main { width: 100%; margin-left: 0; }
    .menu-toggle {
        display: block;
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 1001;
        background: #0c2538;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 12px;
        cursor: pointer;
        font-size: 1.25rem;
        line-height: 1;
        width: auto;
        min-width: 44px;
        text-align: center;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.active { display: block; }
}

@media (min-width: 769px) {
    .menu-toggle { display: none; }
    .sidebar-overlay { display: none !important; }
    .w-72 { position: relative; left: 0 !important; }
    .mobile-header-spacer { display: none; }
}

/* Stats cards responsive */
@media (max-width: 640px) {
    .grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 { 
        grid-template-columns: 1fr; 
    }
    .stat-card { 
        padding: 1rem; 
    }
    .stat-card .text-3xl { 
        font-size: 1.75rem; 
    }
}

/* Filter bar responsive */
@media (max-width: 768px) {
    .flex-wrap { 
        flex-direction: column; 
    }
    select, .flex-1 input { 
        width: 100%; 
    }
}

/* Table responsive */
@media (max-width: 768px) {
    .overflow-x-auto { 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
    }
    table td, table th { 
        padding: 0.75rem 0.5rem; 
    }
    .text-sm { 
        font-size: 0.7rem; 
    }
}

/* Header responsive */
@media (max-width: 640px) {
    h1 { 
        font-size: 1.5rem; 
    }
    .text-sm.text-gray-500.mt-1 { 
        font-size: 0.75rem; 
    }
}

/* Modal responsive */
@media (max-width: 640px) {
    #createUserModal .max-w-2xl { 
        margin: 1rem; 
        width: calc(100% - 2rem); 
    }
    .grid-cols-1.md\:grid-cols-2 { 
        grid-template-columns: 1fr; 
        gap: 0.75rem; 
    }
}

/* Create User button responsive */
@media (max-width: 640px) {
    #openCreateUserModalBtn { 
        width: 100%; 
    }
}

/* Touch-friendly */
@media (max-width: 768px) {
    button, a, .action-pill-view, .action-pill-delete { 
        min-height: 40px; 
    }
    body { 
        font-size: 14px; 
    }
    input, select { 
        font-size: 16px !important; 
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #0d9488;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0f766e;
}

/* Print styles */
@media print {
    .sidebar, nav, .menu-toggle, button {
        display: none !important;
    }
    main {
        margin: 0;
        padding: 0;
    }
    .stat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}