/**
 * Alumni Portal Base Stylesheet
 * Dark mode enabled by default with Tailwind-inspired design
 * All values in REM units
 */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: #181818;
    --bg-hover: #252525;
    --border-color: #2a2a2a;
    --border-light: #3a3a3a;
    --text-primary: #fafafa;
    --text-secondary: #a1a1a1;
    --text-muted: #666;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --shadow: 0 0.25rem 0.375rem -0.0625rem rgba(0,0,0,0.3);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --transition: 200ms ease;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow: 0 0.25rem 0.375rem -0.0625rem rgba(0,0,0,0.07);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: #181818;
    --bg-hover: #252525;
    --border-color: #2a2a2a;
    --border-light: #3a3a3a;
    --text-primary: #fafafa;
    --text-secondary: #a1a1a1;
    --text-muted: #666;
    --shadow: 0 0.25rem 0.375rem -0.0625rem rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 0.5rem; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 0.25rem; }

/* Layout */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 16.25rem;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text { font-weight: 700; font-size: 1.125rem; }
.logo-sub { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.0312rem; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.nav-section { margin-bottom: 1.5rem; }

.nav-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.0312rem;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 0.125rem;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent); color: white; }
.nav-item i { width: 1.25rem; height: 1.25rem; }

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.625rem;
}

.nav-item.active .nav-badge { background: rgba(255,255,255,0.2); }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-color); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.user-menu:hover { background: var(--bg-hover); }

.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1.125rem; }
.avatar-xl { width: 5rem; height: 5rem; font-size: 1.75rem; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-class { font-size: 0.75rem; color: var(--text-muted); }

/* Main Content */
.main { flex: 1; margin-left: 16.25rem; display: flex; flex-direction: column; min-height: 100vh; }

.header {
    height: 4rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 1rem; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 0.5rem; }

.header-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    position: relative;
    transition: all var(--transition);
}

.header-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.header-btn .dot {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--error);
    border-radius: 50%;
}

.theme-toggle {
    display: flex;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    gap: 0.25rem;
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    transition: all var(--transition);
}

.theme-btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow); }

.content { flex: 1; padding: 1.5rem; max-width: 87.5rem; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.75rem; font-weight: 700; display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.page-title i { color: var(--accent); }
.page-desc { color: var(--text-secondary); font-size: 0.9375rem; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border-color); background: var(--bg-tertiary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn i { width: 1.125rem; height: 1.125rem; }
.btn-primary { background: var(--gradient); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-0.0625rem); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--error); color: white; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }
.form-label.required::after { content: '*'; color: var(--error); margin-left: 0.25rem; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 0.1875rem rgba(99, 102, 241, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 7.5rem; resize: vertical; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; }
.form-error { font-size: 0.75rem; color: var(--error); margin-top: 0.375rem; }

/* Grid */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 64rem) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 40rem) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 1.25rem;
    gap: 0.25rem;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--accent); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }

/* Stats */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.purple { background: rgba(99, 102, 241, 0.15); color: var(--accent); }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* Tables */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; background: var(--bg-tertiary); }
.table tr:hover td { background: var(--bg-hover); }

/* Empty State */
.empty-state { text-align: center; padding: 3.75rem 1.25rem; }

.empty-icon {
    width: 5rem;
    height: 5rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--text-muted);
}

.empty-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-text { color: var(--text-secondary); margin-bottom: 1.25rem; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(0.25rem);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 100%;
    max-width: 35rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.active .modal-container { transform: scale(1); }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; background: var(--bg-tertiary); padding: 0.25rem; border-radius: var(--radius-sm); width: fit-content; }

.tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all var(--transition);
}

.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow); }

/* Progress */
.progress { height: 0.5rem; background: var(--bg-tertiary); border-radius: 0.25rem; overflow: hidden; }
.progress-bar, .progress-fill { height: 100%; background: var(--gradient); border-radius: 0.25rem; transition: width 0.5s ease; }

/* Avatar Group */
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -0.5rem; border: 0.125rem solid var(--bg-card); }
.avatar-group .avatar:first-child { margin-left: 0; }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.75rem; }

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 20rem;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { border-left: 0.25rem solid var(--success); }
.toast-error { border-left: 0.25rem solid var(--error); }
.toast-warning { border-left: 0.25rem solid var(--warning); }
.toast-info { border-left: 0.25rem solid var(--info); }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 0.25rem; }
.toast-message { font-size: 0.875rem; color: var(--text-secondary); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(1.25rem); } to { opacity: 1; transform: translateY(0); } }
.animate-fade { animation: fadeIn 0.3s ease; }
.animate-slide { animation: slideUp 0.3s ease; }

/* Responsive */
@media (max-width: 48rem) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: block; }
    .content { padding: 1rem; }
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
