/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary-color: #2c3e50;    /* Dark Blue */
    --accent-color: #3498db;     /* Light Blue */
    --success-color: #27ae60;    /* Green */
    --danger-color: #c0392b;     /* Red */
    --light-bg: #f4f6f9;         /* Light Grey */
    --white: #ffffff;
    --text-color: #333333;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Elements width limit mein rahenge */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px; /* Mobile readability ke liye base size */
    -webkit-tap-highlight-color: transparent; /* Mobile tap color fix */
}

a { text-decoration: none; color: var(--accent-color); }
ul { list-style: none; }

/* =========================================
   2. LAYOUT & CONTAINERS
   ========================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px; /* Mobile par side mein chipkega nahi */
    width: 100%;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    width: 100%;
}

/* =========================================
   3. NAVIGATION BAR (Mobile Optimized)
   ========================================= */
.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 0;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Mobile par content wrap karega */
}

.logo { 
    font-size: 22px; 
    font-weight: bold; 
    color: var(--white); 
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a { 
    color: rgba(255,255,255,0.9); 
    font-weight: 500; 
    font-size: 15px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover { 
    background: rgba(255,255,255,0.1);
    color: white; 
    text-decoration: none;
}

/* =========================================
   4. FORMS & INPUTS
   ========================================= */
.form-group { margin-bottom: 20px; }

label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    font-size: 14px;
    color: #555;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px; /* 16px font se iPhone zoom nahi karega input par */
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea { resize: vertical; min-height: 100px; }

button.btn, .btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: transform 0.1s, background 0.3s;
    /* Mobile Touch Friendly */
    min-width: 120px; 
}

button.btn:active { transform: scale(0.98); }
button.btn:hover { background-color: #2980b9; }

.btn-danger { background: var(--danger-color); }
.btn-success { background: var(--success-color); }

/* =========================================
   5. TABLES (Scrollable on Mobile)
   ========================================= */
/* Admin Panel Table Fix for Mobile */
.card {
    overflow-x: auto; /* Agar table bada hai to horizontal scroll aayega */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 600px; /* Table ko sikudne se bachayega */
}

table th, table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th { 
    background-color: #f8f9fa; 
    color: #444; 
    font-weight: 600;
}

/* =========================================
   6. QUIZ & GRID SYSTEM
   ========================================= */
/* Student Dashboard Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Quiz Options (Big Buttons for Finger Tap) */
.option-btn {
    display: block;
    width: 100%;
    padding: 18px; /* Thoda bada padding */
    margin-bottom: 12px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 17px;
    color: #444;
    transition: all 0.2s;
    position: relative;
}

.option-btn:hover { background-color: #f1f3f5; }
.option-btn.selected {
    background-color: #e8f4fd;
    border-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* =========================================
   7. UTILITIES
   ========================================= */
.alert { padding: 15px; border-radius: 6px; margin-bottom: 20px; font-size: 15px; }
.alert-success { background-color: #d1e7dd; color: #0f5132; }
.alert-danger { background-color: #f8d7da; color: #842029; }

/* =========================================
   8. MOBILE MEDIA QUERIES (The Magic Part)
   ========================================= */
@media (max-width: 768px) {
    
    /* Navbar Stack ho jayega */
    .navbar .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;