/* Reset */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

/* Background */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0b1328;
    margin: 0;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.lamp-img {
    width: 100%;
    display: block;
}

.string {
    position: absolute;
    width: 4px;
    height: 120px;
    background: linear-gradient(to bottom, #ccc, #888);
    top: 20px;
    cursor: pointer;
    z-index: 5;
}

.string-right {
    left: 110px;
}

.string-left {
    left: 80px;
}

.lamp-img:hover {
    filter: drop-shadow(0 0 20px yellow);
    transform: scale(1.1);
    transition: 0.3s;
}

.lamp-wrapper {
    position: relative;
    width: 200px;
    margin: auto;
}

.lamp {
    width: 200px;
}

.light {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 350px;
    background: radial-gradient(circle at top, rgba(255, 255, 180, 0.9), transparent 70%);
    opacity: 0;
    transition: 0.4s;
}

.string:hover {
    transform: scaleY(1.1);
    background: yellow;
}

.login-card {
    background: #213047;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
    text-align: center;
    color: white;
}

.login-card h2 {
    margin-bottom: 20px;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: none;
    border-radius: 8px;
    background: #334155;
    color: rgb(255, 255, 255);
}

.login-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    width: 300px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    transition: 0.5s;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #3b82f6;
}

.lamp {
    position: absolute;
    top: 0;
    font-size: 60px;
    cursor: pointer;
    transition: 0.3s ease;
    animation: swing 2s infinite ease-in-out;
}

.lamp:hover {
    transform: scale(1.2);
}

.login-card.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.light.on {
    background: radial-gradient(circle at top, #fff8dc 10%, #2e2a5e 60%);
}

.light-on.login-container {
    box-shadow: 0 0 40px rgba(255, 255, 150, 00.8);
}

.light-on::after {
    content: "";
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 180, 0.8) 100%, rgba(255, 255, 180, 0.3) 40%, transparent 70%);
    pointer-events: none;
}

@keyframes swing {
    0% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }

    100% {
        transform: rotate(-5deg);
    }
}

/* Main Card */
.dashboard-card,
.card-container {
    background: white;
    width: 380px;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.6s ease-in-out;
}

/* Heading */
h2 {
    margin-bottom: 20px;
    color: #423d3d;
}

/* Navigation Buttons */
.nav-buttons {
    margin-bottom: 20px;
}

.nav-buttons a {
    display: inline-block;
    margin: 6px;
    padding: 8px 14px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.3s;
}

.nav-buttons a:hover {
    background: #5563c1;
    transform: translateY(-2px);
}

/* Analytics Cards */
.analytics {
    margin-top: 10px;
}

.analytics .card {
    background: #f4f4f4;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
}

.analytics .card h3 {
    font-size: 15px;
    margin-bottom: 6px;
    color: #444;
}

.analytics .card p {
    font-size: 20px;
    font-weight: bold;
}

/* Chart Box */
.chart-box {
    margin-top: 20px;
    height: 250px;
}

/* Download Button */
.download-btn {
    margin-top: 15px;
    padding: 8px 15px;
    border: none;
    background: #28a745;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.download-btn:hover {
    background: #218838;
}

/* Forms */
input,
select {
    width: 100%;
    padding: 8px;
    margin: 6px 0;
    border-radius: 5px;
    border: 1px solid #ccc;
}

button {
    width: 100%;
    padding: 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

button:hover {
    background: #5563c1;
    opacity: 0.8;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background: #667eea;
    color: white;
}

/* Back Link */
a {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    color: #667eea;
    font-size: 14px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media(max-width: 480px) {

    .dashboard-card,
    .card-container {
        width: 90%;
    }
}

ul {
    list-style: none;
    padding: 0;
}

li {
    margin-bottom: 15px;

}

.student-name {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.edit-btn {
    flex: 1;
    background: #f6ad55;

}

.delete-btn {
    flex: 1;
    background: #e53e3e;
}

#search {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.chart-container {
    width: 100%;
    height: 300px;
    margin-top: 20px;
}

canvas {
    width: 100% !important;

}

#attendanceChart {
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

.card-container:hover,
.dashboard-card:hover {
    transform: scale(1.02);
    transition: 0.3s ease;
}

button {
    font-weight: bold;

}

h2 {
    letter-spacing: 1px;
}

.logout-container {
    margin-top: 15px;
    text-align: center;
}

.logout-btn {
    width: auto;
    padding: 8px 20px;
    background: #dc3545;
    border-radius: 6px;
}

.logout-btn:hover {
    background: #c82333;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 220px;
    background: #111827;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar a {
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: 0.3s;
}

.sidebar a:hover {
    background: #374151;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-badge {
    background: #3b82f6;
    padding: 6px 12px;
    border-radius: 20px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-align: center;
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.chart-wrapper {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.08);
    padding: 30px;
    border-radius: 20px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chart-title {
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.chart-wrapper canvas {
    max-height: 300px !important;
}

.student-section {
    margin-top: 40px;
}

#studentList {
    margin-top: 15px;
}

.form-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.form-card input {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
}

.student-section {
    margin-top: 30px;
}

#studentList li {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: 0.3s;
}

#studentList li:hover {
    transform: scale(1.02);
}

.btn-group button {
    border-radius: 8px;
}

.main-content {
    animation: fadeSlide 0.6s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.attendance-list {
    margin-top: 20px;
}

.attendance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.attendance-row span {
    font-weight: 500;
}

.attendance-row select {
    width: 120px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ef4444;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #22c55e;
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #22c55e;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    opacity: 0;
    transition: 0.5s;
}

.toast.show {
    opacity: 1;
}

.filter-card {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #94a3b8;
}

.filter-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.15);
}

.table-wrapper {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 15px;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper th {
    background: #3b82f6;
    color: white;
    padding: 10px;
}

.table-wrapper td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.badge-green {
    background: #22c55e;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-red {
    background: #ef4444;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.date-group {
    margin-bottom: 40px;
}

.date-heading {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #60a5fa;
}

.class-badge {
    background: #6366f1;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.filter-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    font-size: 15px;
    transition: all 0.3s ease;
}

select {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

select option {
    color: black;
    /* 🔥 important */
    background-color: white;
}

.month-filter {
    margin-bottom: 20px;
}

.month-filter input {
    padding: 8px;
    border-radius: 6px;
    border: none;
}

.subject-heading {
    margin-top: 20px;
    color: #4da3ff;
    font-weight: 600;
}

.subject-summary {
    font-size: 14px;
    color: #9ecbff;
    margin-bottom: 8px;
}

.date-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.date-heading {
    color: #4da3ff;
    margin-bottom: 15px;
}

.date-group {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.class-block {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.class-heading {
    color: #4da3ff;
    margin-bottom: 15px;
}

/* Student Card on Add-Student page */
.student-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: 0.3s;
}

.student-card:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.student-card strong {
    color: #e2e8f0;
    font-size: 15px;
}

/* Student row on Mark Attendance page */
.student-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #e2e8f0;
}

/* Loading placeholder */
.loading-placeholder {
    color: #9ca3af;
    padding: 16px;
    font-style: italic;
}

/* Logo sub-text */
.logo-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-top: -10px;
    padding-left: 2px;
}

.sidebar h2.logo {
    color: #60a5fa;
    font-size: 18px;
    letter-spacing: 1px;
}

/* Base Responsive CSS and Top Bar Button */
.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

/* Responsive Media Queries */
@media screen and (max-width: 768px) {
    .menu-btn {
        display: block;
    }

    .main-container,
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 250px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
        padding: 15px;
        overflow-x: hidden;
    }

    .lamp-wrapper,
    .light-on::after {
        display: none;
        /* Can get cluttered on mobile login */
    }

    .login-container,
    .login-card {
        width: 90%;
        margin: auto;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        font-size: 14px;
        padding: 5px;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filter-card {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
        min-width: 100%;
        flex: none;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-wrapper canvas {
        width: 100% !important;
        height: auto !important;
    }
}

/* MOBILE RESPONSIVE */

@media (max-width: 768px) {

    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: 0.3s;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .form-card {
        width: 100%;
    }

    .top-bar {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .menu-btn {
        background: #4f7cff;
        color: white;
        border: none;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 18px;
        cursor: pointer;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    button {
        width: 100%;
        margin-top: 10px;
    }

}
.modal{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.7);
display:none;
justify-content:center;
align-items:center;
z-index:1000;
}

.modal-content{
background:#111827;
padding:20px;
border-radius:12px;
text-align:center;
}