/* Responsive Styles for Mobile Devices */
@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* Sidebar becomes a top horizontal scrollable navigation */
    .sidebar {
        width: 100%;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        z-index: 100;
        position: sticky;
        top: 0;
    }

    .logo-container {
        margin-bottom: 1rem;
        justify-content: center;
    }

    .toggle-btn {
        display: none;
    }

    .logo h2 {
        margin-bottom: 0;
        font-size: 1.5rem;
        justify-content: center;
    }

    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        gap: 0.5rem;
        /* Hide scrollbar for a cleaner look */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        white-space: nowrap;
        border-radius: 20px;
        margin-left: 0;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Main content spacing adjustments */
    .main-content {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    header p {
        font-size: 0.9rem;
    }

    header {
        margin-bottom: 1.5rem;
    }

    /* Dashboard Stats stacking */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.2rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-number span {
        font-size: 0.9rem !important;
    }

    /* Forms */
    .form-container {
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .form-section {
        padding: 1.5rem 1.2rem;
        margin-bottom: 1rem;
    }

    .form-section-header {
        margin-bottom: 1rem;
    }

    .form-section-header span {
        font-size: 1.3rem;
    }

    .form-section h3 {
        font-size: 1.05rem;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .class-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        padding: 0.8rem;
    }

    /* Upload Area */
    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        width: 40px;
        height: 40px;
    }

    .upload-desc {
        font-size: 0.8rem;
    }

    /* Data Table */
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .table-container {
        padding: 1rem;
    }

    .data-table {
        table-layout: auto;
    }
    
    .data-table th, .data-table td {
        padding: 10px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}
