/* ===============================
   Student Management System Styles
   =============================== */

/* -------------------------------
   General Styles
---------------------------------*/
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fc;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1; /* Pushes footer to bottom */
}

/* -------------------------------
   Login Page Styles
---------------------------------*/
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.card-body {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #262649 0%, #272041 100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* Login Button Glow Effect */
.login-body .btn-primary {
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
}

.login-body .btn-primary:hover {
    background-color: #5a3e99; /* darker shade */
    box-shadow: 0 0 20px rgba(118, 75, 162, 0.8),
                0 0 40px rgba(118, 75, 162, 0.6);
    transform: translateY(-2px);
}

/* Password toggle button */
#togglePassword {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#togglePassword:hover {
    transform: scale(1.2);
}

/* -------------------------------
   Navbar & Sidebar
---------------------------------*/
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.25rem 0.5rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    font-weight: 600;
}

/* -------------------------------
   Cards & Stats
---------------------------------*/
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    background: rgba(255,255,255,0.95);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    font-weight: 600;
}

.dashboard-card {
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card h6 { font-size: 14px; opacity: 0.8; }
.dashboard-card h3 { font-weight: bold; }
.card-icon {
    position: absolute;
    right: 20px; bottom: 20px;
    font-size: 2rem; opacity: 0.2;
}

.gradient-blue { background: linear-gradient(135deg, #1e3c72, #2a5298); }
.gradient-green { background: linear-gradient(135deg, #1e6f5c, #28a745); }
.gradient-yellow { background: linear-gradient(135deg, #f0ad4e, #ffc107); }
.gradient-purple { background: linear-gradient(135deg, #764ba2, #9a5edd); }

/* Glass Cards */
.glass-card {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    color: #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

/* -------------------------------
   Buttons
---------------------------------*/
.btn {
    border-radius: 0.35rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-gradient {
    background: linear-gradient(135deg,#764baa,#9a5edd);
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}

.btn-gradient:hover {
    background: linear-gradient(135deg,#9a5edd,#764baa);
    box-shadow: 0 0 15px rgba(118,75,162,0.7);
}

/* -------------------------------
   Forms & Inputs
---------------------------------*/
.form-control, .form-select {
    border-radius: 0.35rem;
    border: 1px solid #d1d3e2;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-label {
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.5rem;
}

/* -------------------------------
   Tables & Badges
---------------------------------*/
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
    background-color: #f8f9fc;
}

.table td {
    vertical-align: middle;
    border-top: 1px solid #e3e6f0;
}

.badge {
    font-size: 0.75em;
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: 0.35rem;
}

/* -------------------------------
   Footer
---------------------------------*/
footer {
    margin-top: auto;
    background: rgba(0,0,0,0.6);
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    backdrop-filter: blur(6px);
}

/* -------------------------------
   Animations
---------------------------------*/
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------
   Scrollbars
---------------------------------*/
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* -------------------------------
   Responsive Design
---------------------------------*/
@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
        padding: 0;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Sidebar base styles */
#mySidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: #1c1c1c; /* Light black background */
    color: #ccc;
    overflow-y: auto;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1050;
}

#mySidebar.open {
    left: 0;
}

#mySidebar a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

#mySidebar a:hover,
#mySidebar a.active {
    background-color: #343434;
    border-left: 3px solid #0d6efd;
    color: #fff;
}

/* Profile Section */
#mySidebar .profile-section {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #444;
}

#mySidebar .profile-section img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid #0d6efd;
}

#mySidebar .profile-section small {
    color: #aaa;
}

/* Logout Section */
#mySidebar .logout-section {
    border-top: 1px solid #444;
    padding: 15px 20px;
}

#mySidebar .logout-section a {
    color: #dc3545;
    font-weight: 600;
}

/* Main content margin */
#main-content.sidebar-open {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

/* Overlay for mobile */
#sidebarOverlay {
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.4);
    z-index:1040;
    display:none;
}

#sidebarOverlay.active {
    display:block;
}

/* Close button inside sidebar */
#mySidebar .close-btn {
    display: none;
    position: absolute;
    top:10px;
    right:10px;
    color: #fff;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Responsive for mobile */
@media (max-width: 768px){
    #mySidebar {
        width: 280px; /* keep fixed width */
        left: -280px;
    }
    #mySidebar.open {
        left:0;
    }
    #mySidebar .close-btn {
        display: block;
    }
    #main-content.sidebar-open {
        margin-left: 0;
    }
}
