/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #000080;      /* Navy Blue from logo */
    --primary-light: #2c3e8a;
    --secondary: #8B0000;    /* Maroon/Dark Red from logo */
    --success: #4cc9f0;
    --danger: #d90429;
    --warning: #FFD700;      /* Gold from logo */
    --dark: #1a1a2e;
    --gray: #6c757d;
    --light: #f4f6f9;
    --white: #ffffff;
    --border: #e2e8f0;
    --sidebar-width: 250px;
    --header-height: 60px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    font-size: 14px;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4 { color: var(--dark); font-weight: 600; margin-bottom: 1rem; }
a { text-decoration: none; color: var(--primary); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--secondary); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #d90429; }
.btn-warning { background: #f0ad4e; color: var(--white); }
.btn-warning:hover { background: #eea236; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-danger-outline { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger); color: var(--white); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2); }

/* Layout: Login */
/* Layout: Login */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
.login-card h2 { text-align: center; margin-bottom: 1.5rem; color: var(--primary); }
.login-logo { display: block; margin: 0 auto 1.5rem auto; max-width: 150px; height: auto; }
.alert { padding: 0.75rem; border-radius: 4px; margin-bottom: 1rem; display: none; }
.alert-error { background: #ffe5ec; color: var(--danger); border: 1px solid #ffb3c6; }

/* Layout: Dashboard App */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    height: 100%;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
    background: #f8f9fa;
    color: var(--primary);
    border-left: 3px solid var(--primary);
}
.nav-item i { margin-right: 10px; width: 20px; text-align: center; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8f9fa; font-weight: 600; color: var(--gray); }
tr:hover { background: #f8f9fa; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--white);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}
.close-modal { position: absolute; top: 1rem; right: 1rem; cursor: pointer; font-size: 1.5rem; color: var(--gray); }

/* Dashboard Grid */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); padding: 1.5rem; border-radius: 8px; border-left: 4px solid var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.stat-card h3 { color: var(--gray); font-size: 0.9rem; margin-bottom: 0.5rem; }
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--dark); }

/* Timetable specific */
.timetable-grid {
    display: grid;
    grid-template-columns: 80px repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    width: 100%;
}
.timetable-header, .timetable-cell { background: var(--white); padding: 5px; text-align: center; }
.timetable-header { font-weight: bold; background: #f8f9fa; }
.timetable-period { background: #f8f9fa; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.timetable-cell { min-height: 80px; position: relative; word-break: break-word; }
.draggable-item {
    background: var(--primary-light); color: var(--white);
    padding: 5px; border-radius: 4px; margin: 2px 0;
    cursor: grab; font-size: 0.75rem; line-height: 1.2;
    white-space: normal; word-break: break-word;
}
.draggable-item:active { cursor: grabbing; }

/* Utilities */
.hidden { display: none !important; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.gap-1 { gap: 1rem; }

/* Footer Styles */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    color: #666;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    z-index: 9999;
    box-sizing: border-box;
}

body {
    padding-bottom: 50px;
}

/* Responsive Design & Mobile Menu */
.header-title {
    display: flex;
    align-items: center;
}
.mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1.2rem;
    color: var(--primary);
    cursor: pointer;
    margin-right: 1rem;
    width: 35px;
    height: 35px;
    transition: var(--transition);
}
.mobile-menu-btn:hover {
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1001;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
    }
    .sidebar.show {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .header {
        padding: 0 1rem;
    }
    .content-area {
        padding: 1rem;
    }
    .dashboard-stats, .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
        width: auto;
    }
    .timetable-grid {
        grid-template-columns: 60px repeat(5, minmax(100px, 1fr));
        overflow-x: auto;
    }
    
    /* Teacher specific */
    .teacher-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
