:root {
    /* Colors Adjusted for better contrast & readability (WCAG) */
    --primary: #1d4ed8; /* Blue 700 - deeper for contrast */
    --primary-light: #3b82f6; /* Blue 500 */
    --primary-dark: #1e3a8a; /* Blue 900 */
    
    --secondary: #d97706; /* Amber 600 */
    --success: #059669; /* Emerald 600 */
    --danger: #dc2626; /* Red 600 */
    --warning: #d97706; /* Amber 600 */
    
    --background: #f1f5f9; /* Slate 100 - softer for eyes on PC */
    --surface: #ffffff;
    
    --text-main: #0f172a; /* Slate 900 - very dark for high readability */
    --text-muted: #475569; /* Slate 600 - dark enough for reading */
    --border: #cbd5e1; /* Slate 300 - clearer borders */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.25s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px; /* Base size adjusted for better reading */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout for Mobile First -> Desktop */
.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--surface);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* PC / Desktop Responsive Adjustments for Student Portal */
@media (min-width: 640px) {
    .container {
        min-height: calc(100vh - 4rem);
        margin: 2rem auto;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-xl);
        overflow: hidden;
    }
}

.admin-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    background: transparent;
}

@media (min-width: 1024px) {
    .admin-container {
        padding: 2.5rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
    background-color: var(--surface);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

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

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

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--background);
    border-color: var(--text-muted);
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2.5rem 2rem;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
    .app-header {
        border-radius: 0; 
        border-bottom-left-radius: 1.5rem;
        border-bottom-right-radius: 1.5rem;
    }
}

.app-header.small {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.app-header.small .back-btn {
    color: white;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.app-header.small .back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.header-title {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: white;
}

.header-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    color: white;
}

/* Login Page specific */
.login-content {
    flex: 1;
    padding: 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-container {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-circle {
    width: 88px;
    height: 88px;
    background: var(--primary-light);
    color: white;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-md);
}

/* Menu Page */
.menu-content {
    padding: 2rem;
    flex: 1;
}

.welcome-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.avatar {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.menu-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    cursor: pointer;
}

.menu-item:hover {
    border-color: var(--primary-light);
    background-color: #f8fafc;
    transform: translateX(4px);
}

.menu-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.menu-text {
    flex: 1;
}

.menu-text h3 {
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
    color: var(--text-main);
}

.menu-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* File Upload custom */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    background-color: var(--background);
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-light);
    background-color: rgba(59, 130, 246, 0.05);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

#preview-container {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* Toggle Switch */
.switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Admin Dashboard Specific */
.admin-navbar {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (min-width: 768px) {
    .admin-navbar {
        padding: 1rem 2.5rem;
    }
}

.admin-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.admin-header h1 {
    font-size: 1.75rem;
    color: var(--text-main);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon.all { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.stat-icon.processing { background: rgba(217, 119, 6, 0.15); color: var(--warning); }
.stat-icon.done { background: rgba(5, 150, 105, 0.15); color: var(--success); }

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-top: 0.25rem;
}

.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.tab {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #f8fafc;
}

.table tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-processing {
    background: rgba(217, 119, 6, 0.15);
    color: #b45309;
}

.badge-done {
    background: rgba(5, 150, 105, 0.15);
    color: #047857;
}

/* Responsive Table */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
}
