:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --accent: #38BDF8;
    --danger: #EF4444;
    --success: #10B981;
    --border: #334155;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: rgba(30, 41, 59, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
}

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

.logo {
    display: inline-block;
    transition: transform 0.3s ease;
}
.logo:hover { transform: scale(1.03); }
.brand-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 0.5rem;
}

.sidebar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: var(--primary);
    color: white;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px; /* Same as sidebar width */
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Put content on the right */
    padding: 1rem 2rem;
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 900;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.username {
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: rgba(255, 255, 255, 0.1);
}

.role-admin { color: #FCA5A5; background-color: rgba(239, 68, 68, 0.2); }
.role-manager { color: #FCD34D; background-color: rgba(245, 158, 11, 0.2); }
.role-admission { color: #6EE7B7; background-color: rgba(16, 185, 129, 0.2); }
.role-attender { color: #BAE6FD; background-color: rgba(56, 189, 248, 0.2); }
.role-student { color: #C4B5FD; background-color: rgba(139, 92, 246, 0.2); }

.btn-logout {
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--danger);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: var(--danger);
    color: white;
}

/* Main Container */
.container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* Components */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #FCA5A5;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #6EE7B7;
}

/* Notifications */
.notification-wrapper {
    position: relative;
    cursor: pointer;
}

.notification-bell {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.notification-wrapper:hover .notification-bell {
    color: var(--accent);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    width: 300px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.loader-spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.guest-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
}

.notification-dropdown.active {
    display: block;
}

.notification-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
    background-color: rgba(255, 255, 255, 0.03);
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
}

.notification-item-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.notification-item-msg {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-item-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: block;
}

.notification-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.floating-about-btn {
    position: fixed; 
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    z-index: 9999; 
    background: linear-gradient(135deg, #6366f1, #a855f7); 
    color: white; 
    border: none; 
    padding: 1rem; 
    border-radius: 50px; 
    font-weight: 700; 
    cursor: grab; 
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 0.5rem; 
    writing-mode: vertical-rl; 
    text-orientation: mixed; 
    width: 45px; 
    height: 120px; 
    font-size: 0.85rem; 
    letter-spacing: 1px; 
    transition: all 0.3s;
}

@media print {
    .navbar, .btn, .user-menu, .form-group, footer, .modal-backdrop {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .container {
        padding: 0;
        max-width: 100%;
    }
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        margin-bottom: 20px;
        break-inside: avoid;
    }
    .card-title, h1, h2 {
        color: black !important;
    }
}
