/* ========== GLOBAL RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #333;
}

/* ========== LOGIN PAGE ONLY ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1d72ff, #6ea8ff);
}

.login-card {
    background: #ffffff;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

    .login-card h2 {
        margin-bottom: 20px;
        text-align: center;
        color: #1d72ff;
    }

    .login-card input {
        width: 100%;
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
        border: 1px solid #ddd;
    }

    .login-card button {
        width: 100%;
        padding: 12px;
        background: #1d72ff;
        border: none;
        color: white;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
    }

        .login-card button:hover {
            background: #1559d6;
        }

/* ========== DASHBOARD LAYOUT ========== */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #f5f0e6; /* cream */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
}

.menu-toggle {
    font-size: 22px;
    cursor: pointer;
}

.banner-title {
    font-size: 20px;
    font-weight: 600;
}

/* TOP BANNER RIGHT */
.banner-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #1d3c78;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 1001;
}

    .user-dropdown.show {
        display: block;
    }

    .user-dropdown ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .user-dropdown li {
        padding: 10px 15px;
    }

        .user-dropdown li:hover {
            background-color: #f4f6f8;
        }

    .user-dropdown a {
        color: #333;
        text-decoration: none;
        display: block;
        width: 100%;
    }

/* ================= SIDE MENU ================= */
.side-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 220px;
    height: calc(100vh - 60px);
    background-color: #e6f0ff;
    transition: width 0.3s ease;
    overflow: hidden;
}

    .side-menu ul {
        list-style: none;
        padding-top: 15px;
        margin: 0;
    }
/* ================= SIDE MENU ================= */
.side-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 220px;
    height: calc(100vh - 60px);
    background-color: #e6f0ff;
    transition: width 0.3s ease;
    overflow: hidden;
}

    .side-menu ul {
        list-style: none;
        padding-top: 15px;
        margin: 0;
    }

    /* MAIN MENU ITEMS */
    .side-menu li {
        display: flex;
        align-items: center;
        cursor: pointer;
        color: #1d3c78;
        margin: 0;
        padding: 0; /* Add this to remove any padding */
    }

        /* Put padding on the a tag instead */
        .side-menu li a {
            display: flex;
            align-items: center;
            width: 100%;
            text-decoration: none;
            color: #1d3c78;
            padding: 12px 20px;
        }

            /* Remove blue link colors for all states */
            .side-menu li a:link,
            .side-menu li a:visited,
            .side-menu li a:hover,
            .side-menu li a:active {
                color: #1d3c78;
                text-decoration: none;
            }

            /* Hover effect for menu links */
            .side-menu li a:hover {
                background-color: #d4e4ff;
                border-radius: 6px;
            }

            /* Icon in main menu */
            .side-menu li a i,
            .side-menu li.has-submenu > span i {
                width: 25px;
                text-align: center;
                margin-right: 10px;
                line-height: 1;
                flex-shrink: 0;
            }

            /* Text in main menu */
            .side-menu li a span,
            .side-menu li.has-submenu > span span:not(.submenu-arrow) {
                flex-grow: 1;
                display: flex;
                align-items: center;
                justify-content: space-between;
            }

        /* Remove the old hover effect from li since it's now on the a tag */
        .side-menu li:hover {
            background-color: transparent;
        }

        /* ================= SUBMENU ================= */
        /* For submenu parent (Register) */
        .side-menu li.has-submenu {
            display: flex;
            flex-direction: column;
            margin: 0; /* Ensure no margin */
        }

            /* Make the Register span look exactly like the a tags */
            .side-menu li.has-submenu > span {
                display: flex;
                align-items: center;
                padding: 12px 20px;
                cursor: pointer;
                color: #1d3c78;
                width: 100%;
                text-decoration: none;
                margin: 0; /* Ensure no margin */
            }

                .side-menu li.has-submenu > span:hover {
                    background-color: #d4e4ff;
                    border-radius: 6px;
                }

            /* Submenu container - FIX: Remove from flow when not active */
            .side-menu li.has-submenu > .submenu {
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.3s ease;
                margin: 0; /* Remove margin */
                padding: 0; /* Remove padding */
                /* Remove from document flow when collapsed */
                position: relative;
            }

            .side-menu li.has-submenu.active > .submenu {
                max-height: 500px;
            }

/* Submenu list items */
.submenu li {
    display: flex;
    align-items: center;
    margin: 0; /* Remove margin */
}

    .submenu li a {
        padding: 12px 20px 12px 45px !important;
        width: 100%;
        margin: 0; /* Remove margin */
    }

    .submenu li:hover {
        background-color: #d4e4ff;
        border-radius: 6px;
    }

    .submenu li i {
        width: 25px;
        text-align: center;
        margin-right: 10px;
    }

/* Arrow for submenu toggle */
.has-submenu > span .submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    margin-right: 0;
}

.has-submenu.active > span .submenu-arrow {
    transform: rotate(180deg);
}

/* ================= COLLAPSED MENU ================= */
.side-menu.collapsed {
    width: 60px;
}

    /* Hide text when collapsed */
    .side-menu.collapsed li a span,
    .side-menu.collapsed li.has-submenu > span span {
        display: none;
    }

    /* Hide arrow when collapsed */
    .side-menu.collapsed .submenu-arrow {
        display: none;
    }

    /* Make sure collapsed menu items are centered */
    .side-menu.collapsed li a,
    .side-menu.collapsed li.has-submenu > span {
        padding: 12px;
        justify-content: center;
    }

        /* Center icons when collapsed */
        .side-menu.collapsed li a i,
        .side-menu.collapsed li.has-submenu > span i {
            margin-right: 0;
        }

    /* FIX: Ensure submenu doesn't take space when collapsed */
    .side-menu.collapsed li.has-submenu > .submenu {
        display: none !important;sv
        max-height: 0 !important;
        height: 0 !important;
        visibility: hidden !important;
    }


.has-submenu.active > span .submenu-arrow {
    transform: rotate(180deg);
}

/* MAIN CONTENT */
.main-content {
    margin-top: 60px;
    margin-left: 220px;
    padding: 25px;
    background: #ffffff;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
}

    .main-content.expanded {
        margin-left: 60px;
    }

/* ================= DASHBOARD GRID ================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ================= DASHBOARD CARD ================= */
.dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .dashboard-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    }

    .dashboard-card h3 {
        margin: 15px 0 5px;
        font-size: 17px;
        color: #1d72ff;
    }

    .dashboard-card p {
        font-size: 26px;
        font-weight: bold;
        color: #333;
    }

    .dashboard-card small {
        color: #777;
    }

/* Icon at top of card */
.card-icon {
    color: #1d72ff;
}

/* ================= CHART SECTION ================= */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

/* Chart container card */
.chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* ================= RECENT ACTIVITY ================= */
.recent-activity {
    margin-top: 30px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

    .recent-activity table {
        width: 100%;
        border-collapse: collapse;
    }

    .recent-activity th,
    .recent-activity td {
        padding: 12px 10px;
        border-bottom: 1px solid #ddd;
        text-align: left;
    }

    .recent-activity th {
        background: #f5f5f5;
    }


/* ================= REGISTRATION PAGE ================= */
.register-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

    .register-container h1 {
        color: #1d3c78;
        margin-bottom: 1.5rem;
        text-align: center;
    }

.register-form .form-group {
    margin-bottom: 1.5rem;
}

.register-form .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

.register-form .form-control {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 100%;
}

    .register-form .form-control:focus {
        border-color: #1d72ff;
        box-shadow: 0 0 0 3px rgba(29, 114, 255, 0.1);
        outline: none;
    }

.password-input {
    position: relative;
}

    .password-input .form-control {
        padding-right: 45px;
    }

    .password-input .toggle-password {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #666;
        cursor: pointer;
        padding: 5px;
    }

        .password-input .toggle-password:hover {
            color: #1d72ff;
        }

.register-form .form-check-input {
    margin-right: 0.5rem;
}

.register-form .form-check-label {
    cursor: pointer;
}

.register-form .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.register-form .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border: 1px solid transparent;
}

.register-form .btn-primary {
    background-color: #1d72ff;
    border-color: #1d72ff;
    color: white;
}

    .register-form .btn-primary:hover {
        background-color: #1559d6;
        border-color: #1559d6;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(29, 114, 255, 0.2);
    }

.register-form .btn-outline-secondary {
    border-color: #ddd;
    color: #666;
    background: white;
}

    .register-form .btn-outline-secondary:hover {
        background-color: #f8f9fa;
        border-color: #ccc;
    }

.register-form .btn-link {
    color: #1d72ff;
    background: none;
    border: none;
    padding: 0.75rem 0;
}

    .register-form .btn-link:hover {
        text-decoration: underline;
        background: none;
    }

.text-danger {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Parent Registration Styles */
.register-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.register-container h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-container h1 i {
    color: #3498db;
}

.register-form .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

.register-form .form-control {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 15px;
}

.register-form .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.2);
    outline: none;
}

.register-form .form-check {
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.register-form .form-check-label {
    color: #34495e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.register-form .form-check-input {
    margin-right: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    cursor: pointer;
}

.register-form .form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.register-form .form-actions {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.register-form .btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.register-form .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1c6ea4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.register-form .btn-outline-secondary {
    padding: 0.75rem 2rem;
    border: 2px solid #bdc3c7;
    background: transparent;
    color: #7f8c8d;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s;
}

.register-form .btn-outline-secondary:hover {
    background: #ecf0f1;
    border-color: #95a5a6;
    color: #34495e;
}

/* Grades and Classes Selection */
.grades-container {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    border: 2px solid #e0e6ed;
    transition: border-color 0.3s;
}

.grades-container.border-danger {
    border-color: #e74c3c;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.class-assignment-row {
    border-left: 4px solid #3498db;
    transition: all 0.3s;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.class-assignment-row:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.remove-assignment {
    padding: 0.75rem;
    margin-top: 1.75rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.remove-assignment:hover {
    background: #e74c3c;
    transform: scale(1.05);
}

/* Form sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.form-section-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: #3498db;
}

/* Validation styles */
.field-validation-error {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.input-validation-error {
    border-color: #e74c3c !important;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 0.25rem rgba(231, 76, 60, 0.2) !important;
}

.is-valid {
    border-color: #27ae60 !important;
}

.is-valid:focus {
    box-shadow: 0 0 0 0.25rem rgba(39, 174, 96, 0.2) !important;
}

/* Alert styles */
.alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* Info text */
.form-text.text-muted {
    font-size: 0.875rem;
    color: #7f8c8d !important;
    margin-top: 0.25rem;
}

/* Password toggle */
.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
}

.toggle-password:hover {
    color: #3498db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .register-container {
        padding: 1.25rem;
        margin: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .class-assignment-row .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .class-assignment-row .col-md-2 {
        margin-top: 0;
    }
    
    .remove-assignment {
        margin-top: 0;
    }
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
.grades-container::-webkit-scrollbar {
    width: 8px;
}

.grades-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.grades-container::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.grades-container::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Change from: */
.register-form .form-group {
    margin-bottom: 1.5rem;
}

/* To: */
.register-parent-form .form-group {
    margin-bottom: 1.5rem;
}

/* Update all other .register-form selectors to .register-parent-form */
.register-parent-form .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

.register-parent-form .form-control {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 100%;
}

/* etc... update all other .register-form styles */