/* ============================================
   AIGame Competition Platform - Dark Cyber Theme
   ============================================ */

/* CSS Variables - Dark Mode (Default) */
:root {
    --bg-primary: #020210;
    --bg-secondary: #0a0a1a;
    --bg-card: #121225;
    --bg-input: #1a1a2e;
    
    --cyan: #38d9f5;
    --cyan-dark: #2ab8d1;
    --purple: #a855f7;
    --purple-dark: #9333ea;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b7280;
    
    --border-color: #2a2a3e;
    
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(56, 217, 245, 0.3);
}

/* Light Mode Variables */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    
    --cyan: #0891b2;
    --cyan-dark: #0e7490;
    --purple: #7c3aed;
    --purple-dark: #6d28d9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --info: #2563eb;
    
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(8, 145, 178, 0.2);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 0.875rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.9rem; }

a {
    color: var(--cyan);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.theme-toggle:hover {
    background: var(--cyan);
    transform: scale(1.1);
}

.brand-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cyan);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--cyan);
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cyan);
    margin: 0;
}

.card-body {
    padding: 1rem;
}

/* Page Header */
.page-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: var(--bg-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

.btn-outline:hover {
    background: var(--cyan);
    color: var(--bg-primary);
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--bg-primary);
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-group {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Forms */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color 0.2s;
    height: 2rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--cyan);
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

select.form-control {
    cursor: pointer;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table th,
.table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(0, 0, 0, 0.2);
}

.table tbody tr:hover {
    background: rgba(56, 217, 245, 0.05);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: capitalize;
}

.badge-pending {
    background: var(--warning);
    color: var(--bg-primary);
}

.badge-active {
    background: var(--success);
    color: white;
}

.badge-closed {
    background: var(--text-muted);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: var(--bg-primary);
}

.grade-distinction {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: var(--bg-primary);
}

.grade-merit {
    background: #a855f7;
    color: white;
}

.grade-pass {
    background: #22c55e;
    color: white;
}

.grade-fail {
    background: #ef4444;
    color: white;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Code */
code {
    font-family: 'Courier New', monospace;
    background: var(--bg-input);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--cyan);
}

.session-code {
    font-size: 1rem;
    letter-spacing: 0.1em;
}

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 80px;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--cyan);
    font-family: 'Russo One', sans-serif;
}

.auth-subtitle {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer .footer-logo-small {
    height: 50px;
    margin-bottom: 1rem;
}

.auth-footer .copyright {
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-contact-compact p {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Public Page */
.public-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.public-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.public-header {
    text-align: center;
    margin-bottom: 2rem;
}

.public-logo {
    height: 80px;
    margin-bottom: 1rem;
}

.public-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.public-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 2.5rem 2rem;
}

.public-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.public-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.public-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .public-grid {
        grid-template-columns: 1fr;
    }
}

/* QR Code */
.qrcode-container {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.qrcode-container img {
    display: block;
}

.session-link {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Leaderboard */
.leaderboard-card {
    min-height: 500px;
}

.leaderboard-table {
    font-size: 1.1rem;
}

.leaderboard-table .score {
    font-family: 'Russo One', sans-serif;
    color: var(--cyan);
}

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.medal-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: var(--bg-primary);
}

.medal-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: var(--bg-primary);
}

.medal-3 {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    color: white;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.live-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.leaderboard-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Sessions Grid */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.session-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.session-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.session-info {
    margin-bottom: 1.5rem;
}

.session-info p {
    margin-bottom: 0.5rem;
}

.session-actions {
    display: flex;
    gap: 0.75rem;
}

/* Topic Grid */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.topic-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s;
}

.topic-card:hover {
    border-color: var(--cyan);
    box-shadow: var(--shadow-glow);
    text-decoration: none;
}

/* Grid 2 columns */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

/* Requirements */
.requirements-list {
    white-space: pre-line;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Criteria Table */
.criteria-table {
    margin-bottom: 1.5rem;
}

.grade-info {
    padding: 1.25rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.grade-info h4 {
    margin-bottom: 1rem;
    color: var(--cyan);
}

.grade-info ul {
    list-style: none;
}

.grade-info li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Enrol List */
.enrol-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.enrol-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.enrol-item:last-child {
    border-bottom: none;
}

.enrol-item.enrolled {
    background: rgba(34, 197, 94, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.student-name {
    flex: 1;
}

.student-id {
    font-size: 0.85rem;
}

.enrolled-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--success);
    color: white;
    border-radius: 4px;
}

.checkbox-group {
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.stats-bar span {
    color: var(--text-secondary);
}

/* Results Table */
.results-table .rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--cyan);
    color: var(--bg-primary);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.results-table .unscored {
    color: var(--text-muted);
}

/* Current Submission */
.current-submission {
    padding: 1.25rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.current-submission h4 {
    color: var(--cyan);
    margin-bottom: 0.75rem;
}

/* Submission Rules */
.submission-rules {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.submission-rules h4 {
    color: var(--cyan);
    margin-bottom: 0.75rem;
}

.submission-rules ul {
    margin-left: 1.25rem;
    color: var(--text-secondary);
}

.submission-rules li {
    margin-bottom: 0.375rem;
}

/* Score Table */
.score-table {
    margin-bottom: 1.5rem;
}

.score-table select {
    width: 80px;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 2.5rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.footer-brand {
    flex-shrink: 0;
}

.footer-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.footer-info {
    flex: 1;
}

.footer .copyright {
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.footer-contact {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.contact-section h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-family: 'Russo One', sans-serif;
}

.contact-section p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-contact {
        justify-content: center;
    }
    
    .nav-logo {
        height: 40px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--text-muted);
}

.help-text {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.help-text p {
    margin-bottom: 0.5rem;
}

.help-text code {
    background: var(--bg-card);
}

/* Action Card (for Submit button on topic page) */
.action-card {
    background: linear-gradient(135deg, rgba(56, 217, 245, 0.1), rgba(168, 85, 247, 0.1));
    border: 2px solid var(--cyan);
}

.action-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-info h3 {
    color: var(--cyan);
    margin-bottom: 0.5rem;
}

.action-info p {
    color: var(--text-secondary);
    margin: 0;
}

.info-card {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
}

.ml-2 {
    margin-left: 0.75rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
}

.tab-link {
    padding: 0.4rem 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.2s;
}

.tab-link:hover {
    color: var(--cyan);
    text-decoration: none;
}

.tab-link.active {
    color: var(--cyan);
    background: var(--bg-card);
    border-bottom: 2px solid var(--cyan);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Builder */
.form-fields-container {
    margin-bottom: 1.5rem;
}

.form-field-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    cursor: move;
}

.form-field-item:hover {
    border-color: var(--cyan);
}

.form-field-item.dragging {
    opacity: 0.5;
}

.field-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
}

.drag-handle:active {
    cursor: grabbing;
}

.field-type-badge {
    background: var(--cyan);
    color: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-timer {
    background: #f59e0b;
    color: #000;
}

.field-item-timer {
    border-left: 3px solid #f59e0b !important;
}

.btn-remove {
    margin-left: auto;
    background: var(--error);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.field-body {
    padding: 1rem;
}

.form-builder-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.total-marks {
    padding: 1rem;
    background: rgba(56, 217, 245, 0.1);
    border: 1px solid var(--cyan);
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1rem;
}

.total-marks span {
    color: var(--cyan);
    font-size: 1.5rem;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* Form Row */
.form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 150px;
}

.col-4 {
    flex: 0 0 33.333%;
}

.col-6 {
    flex: 0 0 50%;
}

/* Current File */
.current-file {
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.filter-tabs .tab {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.filter-tabs .tab.active,
.filter-tabs .tab:hover {
    background: var(--cyan);
    color: var(--bg-primary);
    text-decoration: none;
}

/* Card Subtitle */
.card-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Template Download */
.template-download {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(56, 217, 245, 0.1);
    border: 1px dashed var(--cyan);
    border-radius: var(--radius-sm);
}

.template-download p {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .form-inline .form-group {
        width: 100%;
        min-width: auto;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.625rem 0.5rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
}

/* Utility Classes */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.text-sm {
    font-size: 0.75rem;
}

.text-xs {
    font-size: 0.7rem;
}

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
