/* public/assets/style.css */

/* --- 1. THEME VARIABLES (Management Center) --- */
:root {
    /* Brand Colors */
    --primary: #4f46e5;       /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-light: #e0e7ff; /* Indigo 100 */
    
    /* Functional Colors */
    --success-bg: #d1fae5; --success-text: #065f46; /* Green */
    --warning-bg: #fef3c7; --warning-text: #92400e; /* Amber */
    --danger-bg: #fee2e2;  --danger-text: #b91c1c;  /* Red */
    
    /* Neutrals */
    --bg-body: #f1f5f9;       /* Slate 100 */
    --bg-card: #ffffff;
    --text-main: #0f172a;     /* Slate 900 */
    --text-muted: #64748b;    /* Slate 500 */
    --border: #e2e8f0;        /* Slate 200 */

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;        /* 12px rounded corners */
    --font-main: 'Plus Jakarta Sans', sans-serif;
}

/* --- 2. RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    font-family: var(--font-main);
    font-size: 0.925rem;
    height: 100vh;
    display: flex;
    overflow: hidden; /* Prevent body scroll, let content scroll */
}
a { text-decoration: none; color: inherit; }

/* --- 3. LAYOUT (Sidebar & Main) --- */
.wrapper { display: flex; width: 100%; height: 100%; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: margin-left 0.3s ease;
    z-index: 50;
    flex-shrink: 0;
}
.sidebar-header {
    font-size: 1.25rem; font-weight: 800; color: var(--primary);
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2.5rem;
}
.main-content {
    flex: 1;
    overflow-y: auto; /* Scrollable area */
    padding: 2rem;
    position: relative;
}

/* Mobile Sidebar Toggle & Header */
@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100%; left: -260px; transition: left 0.3s; }
    .sidebar.open { left: 0; box-shadow: var(--shadow-md); }
    .main-content { padding: 1rem; }

    /* The Mobile Header Fix */
    .mobile-header { 
        display: flex !important; 
        align-items: center; 
        justify-content: space-between; 
        padding: 1rem; 
        background: white; 
        border-bottom: 1px solid var(--border); 
        position: fixed; 
        top: 0; left: 0; right: 0; 
        z-index: 40; 
    }
    .wrapper { 
        margin-top: 60px; /* Push content down for mobile header */ 
    }
    /* Fix Grid collapsing on mobile */
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- 4. COMPONENTS --- */

/* Navigation Links */
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 600; font-size: 0.875rem;
    border-radius: 0.5rem; border: 1px solid transparent;
    cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: white; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-body); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--text-muted); }
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: border 0.2s, box-shadow 0.2s;
    background: #fff;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Tables */
.table-responsive { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: white; font-size: 0.9rem; }
th { text-align: left; padding: 1rem; background: var(--bg-body); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
td { padding: 1rem; border-top: 1px solid var(--border); color: var(--text-main); vertical-align: middle; }
tr:hover td { background: #f8fafc; }

/* Status Badges */
.badge { padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg); color: var(--danger-text); }

/* --- 5. UTILITIES --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

/* Suggestions Box (for TA Needs search) */
.suggestions-box {
    position: absolute; width: 100%; background: white; border: 1px solid var(--border);
    border-radius: 0.5rem; max-height: 200px; overflow-y: auto; z-index: 100;
    box-shadow: var(--shadow-md); margin-top: 4px;
}
.suggestion-item { padding: 0.75rem; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid var(--bg-body); }
.suggestion-item:hover { background: var(--primary-light); color: var(--primary); }

/* --- 6. MODAL SYSTEM FIX --- */
#updateModal {
    display: none; /* Controlled by JS */
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7); /* Dark semi-transparent slate */
    z-index: 9999; /* Ensure it is above everything else */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

#updateModal:not(.hidden) {
    display: flex !important;
}

/* Ensure the card inside doesn't shrink too much */
#updateModal .card {
    width: 100%;
    max-width: 650px;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
    position: relative; /* Prevents click-through issues */
}

/* Styling for the modal specific layout */
#updateModal .grid-2 {
    margin-bottom: 1rem;
}

#updateModal .form-group textarea {
    resize: vertical; /* Let users expand the box if they have a lot to say */
    min-height: 80px;
}

/* Make the Cancel button look slightly distinct from the primary action */
.btn-outline {
    border: 1px solid var(--border);
    background-color: transparent;
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: var(--text-muted);
}

.ta-needs-text {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}