/* SRM Student Portal - Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark: #1e293b;
    --dark-secondary: #334155;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.logo {
    color: white;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    color: var(--primary-color);
    margin-right: 10px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

.page h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.page-subtitle {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-form h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.auth-subtitle {
    color: #64748b;
    margin-bottom: 30px;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 5px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20ba5a;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 8px 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

/* Notifications */
.notifications-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.notifications-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark);
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-item {
    display: flex;
    align-items: start;
    gap: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.notification-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 2px;
}

.notification-item h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.notification-item p {
    font-size: 0.875rem;
    color: #64748b;
}

/* Grades Section */
#gradesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.grade-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grade-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.grade-header h3 {
    font-size: 1.2rem;
    color: var(--dark);
}

.course-code {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-marks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.mark-item {
    text-align: center;
    padding: 15px 10px;
    background: var(--light);
    border-radius: 8px;
}

.mark-item span {
    display: block;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 5px;
}

.mark-item strong {
    font-size: 1.2rem;
    color: var(--dark);
}

.grade-summary {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    margin-bottom: 15px;
}

.summary-item {
    text-align: center;
}

.summary-item span {
    display: block;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 5px;
}

.summary-item strong {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* GPA Calculator */
.calculator-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.info-box {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-box h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.info-box ul {
    list-style-position: inside;
    color: #64748b;
}

.calculator-input-section {
    margin-bottom: 30px;
}

#courseInputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.course-input {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.course-header h4 {
    color: var(--dark);
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-row input {
    flex: 1;
}

.marks-row input {
    max-width: 120px;
}

.gpa-result {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
}

.gpa-result h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.result-item {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.result-item span {
    display: block;
    color: #64748b;
    margin-bottom: 10px;
}

.result-item strong {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

/* Timetable */
.timetable-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.timetable-grid {
    display: grid;
    gap: 20px;
}

.timetable-day {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.timetable-day h3 {
    color: var(--dark);
    margin-bottom: 15px;
}

.timetable-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timetable-slot {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    align-items: center;
}

.timetable-slot .time {
    font-weight: 600;
    color: var(--primary-color);
}

.timetable-slot .subject {
    font-weight: 500;
    color: var(--dark);
}

.timetable-slot .room {
    text-align: right;
    color: #64748b;
    font-size: 0.875rem;
}

/* Calendar */
.calendar-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.calendar-grid {
    display: grid;
    gap: 15px;
}

.calendar-event {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.calendar-event:hover {
    transform: translateX(5px);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    background: var(--secondary-color);
    color: white;
    border-radius: 8px;
    padding: 10px;
}

.event-date .date {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.event-date .month {
    font-size: 0.875rem;
    text-transform: uppercase;
}

.event-details h4 {
    color: var(--dark);
    margin-bottom: 5px;
}

.event-details p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Materials Section */
.materials-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.semester-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s ease;
}

.semester-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.semester-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.materials-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.material-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.material-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fecaca, #ef4444);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.material-info {
    flex: 1;
}

.material-info h4 {
    color: var(--dark);
    margin-bottom: 5px;
}

.material-info p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Games Section */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.game-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.game-card h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.game-card p {
    color: #64748b;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

/* About Section */
.about-container {
    display: grid;
    gap: 30px;
}

.creator-section,
.contributors-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.creator-section h2,
.contributors-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark);
}

.creator-card {
    display: flex;
    gap: 30px;
    align-items: center;
    padding: 20px;
    background: var(--light);
    border-radius: 8px;
}

.creator-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.creator-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--dark);
}

.creator-info p {
    color: #64748b;
    margin-bottom: 10px;
}

.creator-desc {
    margin-top: 10px;
    font-style: italic;
}

.contributor-placeholder {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.contributor-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--border);
}

/* Contact Section */
.contact-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.contact-card {
    text-align: center;
    padding: 30px;
    background: var(--light);
    border-radius: 8px;
}

.contact-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.contact-card h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.contact-card p {
    color: #64748b;
    margin-bottom: 20px;
}

.query-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.query-form input,
.query-form textarea {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

.query-form input:focus,
.query-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #64748b;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger-color);
}

.grade-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--border);
}

.empty-state p {
    font-size: 1.1rem;
}

.info-text {
    font-size: 0.875rem;
    margin-top: 10px;
}

/* Admin Panel Styles */
.admin-only {
    display: none;
}

.admin-dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-section h2 i {
    color: var(--primary-color);
}

.admin-card {
    background: var(--light);
    padding: 25px;
    border-radius: 8px;
    margin-top: 15px;
}

.admin-form {
    display: grid;
    gap: 15px;
}

.admin-form .form-group {
    margin-bottom: 0;
}

.admin-list {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.admin-list h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
}

.admin-item-info strong {
    display: block;
    color: var(--dark);
    margin-bottom: 5px;
}

.admin-item-info p {
    font-size: 0.875rem;
    color: #64748b;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.admin-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.admin-stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.admin-stat-item h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 5px;
}

.admin-stat-item p {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.empty-text {
    text-align: center;
    color: #64748b;
    padding: 20px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    #gradesContainer {
        grid-template-columns: 1fr;
    }

    .grade-marks {
        grid-template-columns: repeat(2, 1fr);
    }

    .timetable-slot {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .timetable-slot .room {
        text-align: left;
    }

    .creator-card {
        flex-direction: column;
        text-align: center;
    }

    .contact-methods {
        grid-template-columns: 1fr;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }

    .grade-inputs {
        grid-template-columns: 1fr;
    }

    .materials-nav {
        justify-content: center;
    }

    .semester-btn {
        flex: 1;
        min-width: 100px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .page h1 {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .grade-summary {
        flex-direction: column;
        gap: 10px;
    }

    .material-item {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        flex-direction: column;
    }

    .marks-row input {
        max-width: 100%;
    }
}
