/* =========================================================
   1. BASE VARIABLES & GLOBALS
   ========================================================= */
:root {
    --primary: #0a58ca;       /* Rich Blue matching your screenshot */
    --primary-dark: #053b8f;  /* Darker shade for left side gradient */
    --primary-light: #eff6ff; /* Light Blue background for active items */
    --bg-color: #f8fafc;      /* Soft grey background */
    --card-bg: #ffffff;
    --text-main: #111827;     /* Darker text for better contrast */
    --text-muted: #6b7280;
    --border-radius: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   2. REUSABLE COMPONENTS
   ========================================================= */
.btn {
    padding: 16px;
    border: none;
    border-radius: 24px; /* Pill shape matching screenshot */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

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

.primary-btn:hover {
    background: #084298;
}

.w-100 {
    width: 100%;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

.alert-error {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

/* =========================================================
   3. TEACHER DASHBOARD STYLES (index.php)
   ========================================================= */
.top-bar {
    background: var(--primary);
    color: white;
    padding: 30px 20px 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.user-info h1 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.user-info p { margin: 4px 0 0 0; font-size: 0.85rem; opacity: 0.9; }

.profile-avatar {
    background: rgba(255, 255, 255, 0.2);
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
}

.dashboard-container { padding: 0 20px; margin-top: -20px; }

.overview-banner {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.overview-banner h2 { margin: 0 0 8px 0; font-size: 1rem; color: var(--text-main); }
.overview-banner p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.section-title {
    font-size: 0.9rem; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); margin-bottom: 15px;
}

.action-grid {
    display: grid; grid-template-columns: 1fr; gap: 15px; padding-bottom: 30px;
}

@media (min-width: 600px) { .action-grid { grid-template-columns: 1fr 1fr; } }

.action-card {
    background: var(--card-bg); border: none; padding: 20px;
    border-radius: var(--border-radius); text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: flex; flex-direction: column;
}

.action-card:active { transform: scale(0.98); background: #f1f5f9; }
.action-card.primary { border: 2px solid var(--primary); background: var(--primary-light); }
.action-card .icon { font-size: 2rem; margin-bottom: 12px; }
.action-card h4 { margin: 0 0 4px 0; font-size: 1.1rem; color: var(--text-main); }
.action-card p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }


/* =========================================================
   4. FULL-SCREEN LOGIN LAYOUT (login.php)
   ========================================================= */
.login-layout {
    margin: 0;
    height: 100vh;
    width: 100vw;
    background-color: #ffffff;
    display: flex;
    overflow: hidden; /* Prevents scrolling on desktop */
}

.login-split-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* --- Left Side: Branding (Deep Blue) --- */
.login-brand-side {
    flex: 1;
    /* Deep blue gradient mimicking the screenshot */
    background: linear-gradient(135deg, #0f4c81 0%, #052c54 100%);
    color: white;
    padding: 60px;
    display: none; /* Hidden on mobile */
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

@media (min-width: 900px) {
    .login-brand-side { display: flex; }
}

/* Faint background intersecting circles */
.brand-bg-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
}
.circle-large { width: 800px; height: 800px; top: -200px; right: -300px; border-width: 2px;}
.circle-small { width: 500px; height: 500px; bottom: -100px; left: -150px; border-width: 2px;}

.brand-content-top {
    position: relative;
    z-index: 10;
    margin-top: 15vh;
}

.logo-line {
    width: 40px;
    height: 4px;
    background-color: #60a5fa;
    margin-bottom: 30px;
    border-radius: 2px;
}

.brand-content-top h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 40px;
    font-weight: 700;
    max-width: 90%;
}

.brand-sub-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-sub-text strong {
    font-size: 1.1rem;
    display: block;
}

.brand-sub-text span {
    font-size: 0.9rem;
    color: #93c5fd;
}

.brand-content-bottom {
    position: relative;
    z-index: 10;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* --- Right Side: Form (White) --- */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #ffffff;
}

.form-wrapper {
    width: 100%;
    max-width: 400px; /* Constrains the form width beautifully */
}

.form-header h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
}

.form-header p {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1rem;
}

/* Inputs styled like the screenshot (filled, no border) */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    position: absolute;
    left: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background-color: #f3f4f6; /* Light gray/blue fill */
    border: 1px solid transparent;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 88, 202, 0.1);
    outline: none;
}

.input-wrapper input:focus + .input-icon {
    color: var(--primary);
}

.toggle-password {
    background: none;
    border: none;
    position: absolute;
    right: 16px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
}

.toggle-password svg {
    width: 20px; height: 20px;
}

.toggle-password:hover {
    color: var(--text-main);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    margin-right: 8px;
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}