:root {
    --primary: #1a237e;
    --secondary: #00bcd4;
    --accent: #ff4081;
    --bg: #e8f0fe;
    --text: #212121;
    --success: #00c853;
    --warning: #ffab00;
    --teddy: #ffeb3b;
    --leave: #7c4dff;
    --hover: #b3e5fc;
    --pending: #ff5722;
    --shadow: rgba(0, 0, 0, 0.15);
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #80deea, #b388ff);
    color: var(--text);
    min-height: 100vh;
    overflow-x: auto;
}

body.dark-mode {
    background: linear-gradient(135deg, #2c3e50, #4b0082);
}

.container {
    max-width: 1600px;
    margin: 50px auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 50px var(--shadow);
    padding: 50px;
    animation: floatIn 1s ease-out;
    border: 4px solid var(--secondary);
    position: relative;
    overflow: hidden;
}

@keyframes floatIn {
    0% { transform: translateY(100px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

h1 {
    color: var(--primary);
    text-align: center;
    margin: 30px 0;
    font-size: 3.5em;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
    animation: glowTitle 2s infinite alternate;
}

@keyframes glowTitle {
    0% { text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2); }
    100% { text-shadow: 3px 3px 20px rgba(255, 64, 129, 0.6); }
}

.teddy-welcome {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-bottom: 60px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.4), transparent);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.teddy {
    width: 140px;
    height: 140px;
    background: var(--teddy);
    border-radius: 50%;
    position: relative;
    animation: floatTeddy 3.5s infinite ease-in-out;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    border: 5px solid white;
}

@keyframes floatTeddy {
    0%, 100% { transform: translateY(0) rotate(3deg); }
    50% { transform: translateY(-40px) rotate(-3deg); }
}

.teddy::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    top: 35px;
    left: 35px;
    box-shadow: 40px 0 0 white;
}

.teddy::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--primary);
    border-radius: 50%;
    top: 40px;
    left: 40px;
    box-shadow: 40px 0 0 var(--primary);
    animation: blink 2.5s infinite;
}

@keyframes blink {
    0%, 90% { opacity: 1; }
    95% { opacity: 0; }
    100% { opacity: 1; }
}

.teddy-mouth {
    position: absolute;
    width: 40px;
    height: 25px;
    background: #d81b60;
    border-radius: 0 0 25px 25px;
    top: 80px;
    left: 50px;
    animation: smile 1.5s infinite;
    box-shadow: inset 0 -6px 6px rgba(0,0,0,0.25);
}

@keyframes smile {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.2); }
}

.welcome-text {
    font-size: 3em;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 5px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    color: transparent;
    animation: pulseText 2s infinite;
    text-shadow: 0 0 20px rgba(0, 188, 212, 0.6);
    margin-top: 25px;
}

@keyframes pulseText {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.study-items {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.book, .pen, .laptop {
    position: absolute;
    transition: all 0.3s ease;
}

.book {
    width: 60px;
    height: 70px;
    background: linear-gradient(135deg, #ff4081, #d81b60);
    border-radius: 10px;
    animation: orbitBook 7s infinite ease-in-out;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.book::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 10px;
    background: white;
    top: 20px;
    box-shadow: 0 12px 0 white;
}

@keyframes orbitBook {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0.7; }
    50% { transform: translate(180px, -70px) rotate(180deg); opacity: 1; }
    100% { transform: translate(0, 0) rotate(360deg); opacity: 0.7; }
}

.pen {
    width: 80px;
    height: 8px;
    background: var(--secondary);
    border-radius: 8px;
    animation: twirlPen 5s infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

@keyframes twirlPen {
    0% { transform: translate(-220px, 140px) rotate(0deg); }
    50% { transform: translate(0, 80px) rotate(360deg); }
    100% { transform: translate(220px, 140px) rotate(720deg); }
}

.laptop {
    width: 80px;
    height: 60px;
    background: var(--primary);
    border-radius: 10px;
    animation: pulseLaptop 4s infinite;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.laptop::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 8px;
    background: #e0f7fa;
    top: 10px;
    left: 5px;
}

@keyframes pulseLaptop {
    0% { transform: translate(-270px, 200px) scale(1); }
    50% { transform: translate(-170px, 140px) scale(1.12); }
    100% { transform: translate(-270px, 200px) scale(1); }
}

/* Navigation Styles */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px var(--shadow);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.navbar.dark-mode {
    background: rgba(44, 62, 80, 0.95);
}

.logo {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.teddy-icon {
    margin-right: 10px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-links li a:hover, .nav-links li a.active {
    color: var(--accent);
    text-decoration: underline;
}

.hamburger {
    display: none;
    font-size: 1.5em;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        padding: 20px;
        box-shadow: 0 4px 12px var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }
}

/* Login Modal */
.login-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: 2000;
}

.login-modal.active {
    display: flex;
}

.login-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow);
    width: 100%;
    max-width: 400px;
    position: relative;
}

.login-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

.login-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid var(--secondary);
    border-radius: 10px;
    font-size: 1em;
}

.login-content button {
    width: 100%;
    padding: 12px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-content button:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 50px;
    margin: 30px auto;
    max-width: 1600px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 25px;
}

.hero-content {
    flex: 1;
    padding: 30px;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--text);
}

.cta-button {
    display: inline-block;
    padding: 15px 30px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.hero .teddy-welcome {
    flex: 1;
    margin: 0;
}

/* About Section */
.about {
    padding: 50px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px var(--shadow);
}

.feature-card i {
    font-size: 2em;
    color: var(--secondary);
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* Contact Section */
.contact {
    padding: 50px;
}

.contact-form {
    max-width: 600px;
    margin: 30px auto;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 3px solid var(--secondary);
    border-radius: 12px;
    font-size: 1.2em;
}

.contact-form textarea {
    height: 150px;
    resize: vertical;
}

.contact-form button {
    width: 100%;
    padding: 15px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}

.contact-form button:hover {
    background: var(--accent);
    transform: translateY(-4px);
}

.contact-info {
    text-align: center;
    margin-top: 30px;
}

.contact-info p {
    font-size: 1.1em;
    margin: 10px 0;
}

.contact-info i {
    color: var(--secondary);
    margin-right: 10px;
}

/* Footer */
footer {
    background: var(--primary);
    color: white;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.footer-section p, .footer-section ul li a {
    color: #e0f7fa;
    font-size: 1em;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 10px 0;
}

.footer-section ul li a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: white;
    font-size: 1.5em;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Original Dashboard Styles */
.music-control {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.music-control button {
    padding: 12px 25px;
    background: var(--accent);
    border-radius: 30px;
    border: 3px solid white;
    color: white;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
}

.music-control button:hover {
    transform: scale(1.12);
    background: var(--primary);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    box-shadow: 0 10px 25px var(--shadow);
    border: 2px solid var(--secondary);
}

.calendar-day {
    padding: 18px;
    text-align: center;
    border-radius: 15px;
    background: white;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    border: 3px solid transparent;
}

.calendar-day.present {
    background: var(--success);
    color: white;
    transform: scale(1.12);
    border-color: white;
    box-shadow: 0 6px 18px rgba(0, 200, 83, 0.5);
}

.calendar-day.absent {
    background: white;
    color: var(--text);
}

.calendar-day.pending {
    background: var(--pending);
    color: white;
    animation: pulsePending 1.5s infinite;
}

@keyframes pulsePending {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.calendar-day:not(.day-name):not(.sunday):hover {
    background: var(--hover);
    transform: translateY(-6px) scale(1.06);
    box-shadow: 0 10px 25px var(--shadow);
    border-color: var(--secondary);
}

.calendar-day.sunday {
    background: var(--leave);
    color: white;
    font-weight: 700;
    cursor: not-allowed;
    opacity: 0.95;
    transform: scale(1.03);
}

.status-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    transition: all 0.3s ease;
}

.calendar-day.present .status-dot {
    background: white;
    box-shadow: 0 0 6px white;
}

.day-name {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 6px 18px var(--shadow);
}

.input-section {
    display: flex;
    gap: 25px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 6px 18px var(--shadow);
    border: 2px solid var(--secondary);
}

input {
    padding: 15px 18px;
    border: 3px solid var(--secondary);
    border-radius: 12px;
    font-size: 1.2em;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    width: 200px;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(255, 64, 129, 0.6);
    transform: scale(1.03);
}

button {
    padding: 15px 30px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

button:hover {
    background: var(--accent);
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.attendance-table-wrapper {
    overflow-x: auto;
    margin-top: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 30px var(--shadow);
}

.attendance-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 25px;
    border: 3px solid var(--primary);
    table-layout: auto;
}

th, td {
    padding: 18px;
    text-align: center;
    border-bottom: 3px solid rgba(0, 0, 0, 0.05);
    min-width: 60px;
    white-space: nowrap;
}

th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    position: sticky;
    top: 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    z-index: 1;
}

tr:last-child td {
    border-bottom: none;
}

.present {
    background: var(--success);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.present:hover {
    transform: scale(1.12);
}

.absent {
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.absent:hover {
    background: var(--hover);
}

.leave {
    background: var(--leave);
    color: white;
    font-weight: 700;
}

.pending {
    background: var(--pending);
    color: white;
    cursor: pointer;
    animation: pulsePending 1.5s infinite;
}

.total-cell {
    background: var(--secondary);
    color: white;
    font-weight: 800;
    border-radius: 10px;
}

.tooltip {
    visibility: hidden;
    background: var(--primary);
    color: white;
    text-align: center;
    border-radius: 10px;
    padding: 10px;
    position: absolute;
    z-index: 2;
    font-size: 1em;
    box-shadow: 0 6px 18px var(--shadow);
    transform: translateY(-12px);
    transition: all 0.3s ease;
}

td:hover .tooltip {
    visibility: visible;
    transform: translateY(0);
}

.admin-controls {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    box-shadow: 0 6px 18px var(--shadow);
    border: 2px solid var(--secondary);
}

.admin-controls h3 {
    color: var(--primary);
    margin: 0 0 20px;
    font-size: 1.8em;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    color: transparent;
}

#topStudents p {
    padding: 12px;
    margin: 6px 0;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    color: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
}

#topStudents p:hover {
    transform: translateX(12px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

#topStudents p:nth-child(1) {
    background: linear-gradient(90deg, var(--gold), #ffa500);
}

#topStudents p:nth-child(2) {
    background: linear-gradient(90deg, var(--silver), #87ceeb);
}

#topStudents p:nth-child(3) {
    background: linear-gradient(90deg, var(--bronze), #ff8c00);
}

.summary-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    box-shadow: 0 6px 18px var(--shadow);
    border: 2px solid var(--secondary);
}

.summary-section canvas {
    max-width: 100%;
    margin: 20px auto;
    display: block;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--success);
    color: white;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1000;
}

.notification.error {
    background: var(--pending);
}

.notification.show {
    opacity: 1;
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
        margin: 25px auto;
    }
    th, td {
        padding: 12px;
        min-width: 50px;
    }
    h1 {
        font-size: 2.5em;
    }
    .welcome-text {
        font-size: 2em;
    }
    input {
        width: 100%;
        max-width: 100%;
    }
    .hero {
        flex-direction: column;
        padding: 20px;
    }
    .hero-content {
        text-align: center;
    }
    .hero .teddy-welcome {
        margin-top: 20px;
    }
    .contact-form {
        padding: 0 20px;
    }
}

/* Badges inside .features already styled. Customize icons if needed */
#badge1 i { color: var(--warning); }
#badge2 i { color: var(--accent); }
#badge3 i { color: var(--success); }

