* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
}

/* ------------------------------------------------------------------
 * LOGIN & HOMEPAGE STYLES
 * ------------------------------------------------------------------ */
.login-page {
    /* 🛑 FIX: Background Image for login page */
    background-image: url('../image/dcsa_bg.jpg'); /* Corrected path relative to style.css */
    background-size: cover; 
    background-position: center center; 
    background-repeat: no-repeat; 
    background-color: rgba(0, 0, 0, 0.4); /* Overlay for contrast */
    background-blend-mode: overlay;
    
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

/* 🛑 NEW LOGO CONTAINER STYLES (for index.html image) */
.logo-container {
    text-align: center;
    margin: 0 auto 20px; 
    padding-top: 20px;
}

/* 🛑 MAIN HOMEPAGE LOGO SIZE */
.main-logo {
    width: 100px; 
    height: 100px;
    object-fit: contain; 
    display: block;
    margin: 0 auto; 
}

/* 🛑 LOGIN PAGE LOGO SIZE (Smaller for the login box) */
.main-logo-login {
    width: 80px;  
    height: 80px; 
    object-fit: contain; 
    display: block;
    margin: 0 auto 15px; /* Center and space out */
}
/* 🛑 END NEW LOGO STYLES */


.logo-circle {
    /* Kept but deprecated by new image logo */
    width: 80px;
    height: 80px;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.logo-circle i {
    font-size: 40px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 5px;
}

.login-header p {
    color: #6b7280;
    font-size: 14px;
}

.subtitle {
    font-size: 12px !important;
    color: #9ca3af !important;
    margin-top: 5px;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #2563eb;
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none; 
}

.error-message:not(:empty) {
    display: block;
}

/* ------------------------------------------------------------------
 * NEW ADDITION: Forgot Password Link Styles
 * ------------------------------------------------------------------ */
.forgot-password-link {
    display: block; /* Important to make it take its own line or control placement */
    text-align: right;
    font-size: 14px;
    color: #2563eb; /* Primary color */
    text-decoration: none;
    margin-top: -15px; /* Adjust spacing above the link */
    margin-bottom: 20px; /* Space before the login button */
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* --- END NEW ADDITION --- */


/* --- BUTTON STYLES --- */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #eff6ff;
}

/* 🛑 NEW BUTTON STYLE for "Back to Homepage" */
.btn-tertiary {
    width: 100%;
    padding: 14px;
    background: none;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
    margin-top: 10px;
}
.btn-tertiary:hover {
    color: #1f2937;
}

/* --- END BUTTON STYLES --- */

/* ------------------------------------------------------------------
 * MODIFIED: Demo Accounts for Admin/Professor/Student clarity
 * ------------------------------------------------------------------ */
.demo-accounts {
    margin-top: 25px;
    text-align: center;
    font-size: 13px; /* Slightly larger for readability */
    color: #6b7280;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    line-height: 1.6; /* Better line spacing */
    text-align: left; /* Aligns the demo list nicely */
}

/* Style for the individual demo lines in the new structure (assuming HTML is adjusted) */
.demo-accounts p {
    margin: 3px 0;
    color: #4b5563; /* Darker than the container text */
    font-weight: 500;
}

.demo-accounts .demo-label {
    font-weight: 700;
    color: #1f2937;
    display: block;
    margin-bottom: 5px;
}

.demo-credentials-line {
    display: none; /* Hidden by default, will be shown by JavaScript */
    margin-bottom: 5px;
}

.demo-credentials-line.active-demo {
    display: block;
    font-size: 14px;
}

/* ------------------------------------------------------------------
 * The rest of your styles continue below...
 * ------------------------------------------------------------------ */

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------
 * DASHBOARD LAYOUT & COMPONENTS
 * ------------------------------------------------------------------ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1e40af;
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo i {
    color: #1e40af;
    font-size: 20px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.1);
}

.main-content {
    margin-left: 260px;
    flex: 1;
    background: #f5f5f5;
}

.top-bar {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-size: 24px;
    color: #1f2937;
}

.page-title p {
    font-size: 14px;
    color: #6b7280;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.btn-logout {
    padding: 8px 16px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-area {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.stat-info p {
    font-size: 32px;
    font-weight: bold;
}

.stat-icon {
    font-size: 48px;
    opacity: 0.2;
}

.blue { color: #2563eb; }
.green { color: #10b981; }
.purple { color: #8b5cf6; }
.red { color: #ef4444; }

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
    color: #1f2937;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #2563eb;
    color: white;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

table tbody tr:hover {
    background: #f9fafb;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ------------------------------------------------------------------
 * MODAL STYLES
 * ------------------------------------------------------------------ */
.modal {
    position: fixed; 
    z-index: 1050; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto;
    background-color: rgba(0,0,0,0.5); 
    display: none; 
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: 0 auto; 
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%; 
    max-width: 500px; 
    position: relative;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
}
/* --- END MODAL STYLES --- */


/* ------------------------------------------------------------------
 * CHATBOT STYLES
 * ------------------------------------------------------------------ */

/* Floating Button */
.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #4f46e5; 
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    z-index: 1000; 
}

.floating-chat-btn:hover {
    background: #3730a3; 
    transform: scale(1.05);
}

/* Chatbox Overlay Container */
.chat-overlay {
    position: fixed;
    bottom: 100px; 
    right: 30px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    display: none; 
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
}

.chat-overlay.active {
    display: flex;
}

.chat-header-overlay {
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-content-overlay {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
}

.chat-input-overlay {
    padding: 10px 15px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.chat-input-overlay input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.chat-input-overlay .btn-send {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* Specific message styles */
.chat-message-ai-overlay {
    margin-bottom: 8px;
    text-align: left;
}
.chat-message-ai-overlay span {
    background: #e0f2f1;
    color: #047857;
    padding: 8px 12px;
    border-radius: 15px;
    display: inline-block;
    max-width: 80%;
}
.chat-message-user-overlay {
    margin-bottom: 8px;
    text-align: right;
}
.chat-message-user-overlay span {
    background: #2563eb;
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    display: inline-block;
    max-width: 80%;
}

/* ------------------------------------------------------------------
 * RESPONSIVENESS
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header span,
    .nav-link span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 5% auto; 
    }
}