/* =========================================
   1. CORE VARIABLES & RESET
   ========================================= */
:root {
    --primary: #009688;       
    --primary-dark: #00695c;  
    --secondary: #263238;     
    --bg: #f0f2f5;            
    --surface: #ffffff;       
    --border: #e0e0e0;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
}

/* =========================================
   2. LOGIN SCREEN
   ========================================= */
#login-screen {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.login-card {
    background: var(--surface); padding: 40px; width: 100%; max-width: 400px;
    border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); text-align: center;
}
.logo-img { height: 60px; margin-bottom: 20px; display: block; margin-left: auto; margin-right: auto; }

/* =========================================
   3. LAYOUT
   ========================================= */
header {
    background: var(--surface); height: 64px; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--secondary); }
.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

/* =========================================
   4. COURSE CARDS
   ========================================= */
.grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column;
    position: relative; transition: transform 0.2s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.course-img { height: 150px; width: 100%; object-fit: cover; background: #eee; }
.course-info { padding: 15px; flex-grow: 1; }
.course-info h3 { margin: 0 0 5px 0; font-size: 1.1rem; color: var(--text-main); }

/* =========================================
   5. TABS & NAVIGATION (Fixed)
   ========================================= */
.tabs { display: flex; border-bottom: 2px solid #e5e7eb; margin-bottom: 25px; gap: 5px; }
.tab-btn {
    background: none; border: none; padding: 12px 20px; font-size: 1rem;
    color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent;
    transition: all 0.2s; font-weight: 500;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }

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

/* =========================================
   6. MODULES & LISTS
   ========================================= */
.module-block {
    background: var(--surface); border-radius: var(--radius); margin-bottom: 20px;
    border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm);
}
.module-header {
    background: #f8fafc; padding: 15px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; color: var(--secondary);
}
.unit-block { padding: 0; border-bottom: 1px solid #f0f0f0; }
.unit-title {
    background: #fff; padding: 12px 20px; font-size: 0.85rem; font-weight: 700;
    color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;
    display: flex; justify-content: space-between; align-items: center;
}

/* Files */
.file-item {
    display: flex; align-items: center; padding: 12px 20px; background: #fff;
    border-top: 1px solid #f3f4f6; transition: background 0.2s;
}
.file-item:hover { background: #f8fafc; }
.file-icon-box {
    width: 36px; height: 36px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; font-size: 1.1rem; margin-right: 15px;
}
.icon-pdf { background: #fee2e2; color: #ef4444; }
.icon-video { background: #ffedd5; color: #f97316; }
.icon-link { background: #f3f4f6; color: #4b5563; }
.file-details { flex-grow: 1; }
.file-title { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
.file-meta { font-size: 0.75rem; color: #9ca3af; font-weight: bold; }

/* =========================================
   7. BUTTONS & UTILS
   ========================================= */
.action-btn {
    background: var(--primary); color: white; border: none; padding: 10px 18px;
    border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.action-btn:hover { background: var(--primary-dark); }
.action-btn.small { padding: 6px 12px; font-size: 0.85rem; }

/* Icon Buttons (Edit/Delete) */
.icon-btn { background: none; border: none; cursor: pointer; padding: 5px; opacity: 0.7; transition: 0.2s; font-size: 1.1rem; }
.icon-btn:hover { opacity: 1; transform: scale(1.1); background: rgba(0,0,0,0.05); border-radius: 4px; }
.edit-btn { color: #2563eb; }
.delete-btn { color: #ef4444; }

/* Tools Panel (Cleaner Look) */
.tools-panel {
    background: white; padding: 15px 20px; border-radius: 8px; margin-bottom: 25px;
    border: 1px solid #e5e7eb; display: flex; align-items: center; gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* =========================================
   8. MODALS & TABLES
   ========================================= */
.modal {
    display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px); z-index: 2000; justify-content: center; align-items: center;
}
.modal-box {
    background: white; padding: 30px; border-radius: 12px; width: 90%; max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); position: relative;
    max-height: 90vh; overflow-y: auto;
}
.close { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }

input, select {
    width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px;
    margin: 8px 0; font-size: 0.95rem; box-sizing: border-box;
}

/* Tables */
.table-wrapper { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 20px; }
.data-table { width: 100%; border-collapse: collapse; background: white; white-space: nowrap; }
.data-table th { background: #f9fafb; padding: 12px 16px; text-align: left; font-weight: 600; color: #6b7280; border-bottom: 1px solid #e5e7eb; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #1f2937; }