/* Gameshow Generator - Web Version Styles */

/* CSS Variables */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #3730a3;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --radius: 15px;
    --radius-sm: 10px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth Scrolling - Butter Smooth (JS handles the smoothness, CSS must be auto) */
html {
    scroll-behavior: auto;
}

/* Apply auto to all scrollable elements - JS provides the smooth scrolling */
html, body,
.modal-body,
.table-container,
.sidebar,
.admin-main,
.game-list,
.content-area,
[class*="scroll"],
[style*="overflow"] {
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a3e 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-sm {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-error {
    color: var(--error);
    font-size: 0.9em;
    margin-top: 5px;
}

.form-help {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-top: 5px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--error);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning);
    color: #fcd34d;
}

.alert-info {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid var(--primary);
    color: #a5b4fc;
}

/* Header/Navigation */
.header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--text-light);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-size: 2em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-muted);
    margin-top: 5px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.dashboard-header p {
    color: var(--text-muted);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    margin-top: 5px;
}

/* Action Cards */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.action-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.action-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.action-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
}

.action-desc {
    color: var(--text-muted);
    font-size: 0.95em;
}

/* Games List */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.game-item:hover {
    background: var(--bg-card-hover);
}

.game-info h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.game-meta {
    color: var(--text-muted);
    font-size: 0.9em;
}

.game-actions {
    display: flex;
    gap: 10px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 50px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.upload-text {
    color: var(--text-muted);
}

.upload-text strong {
    color: var(--primary);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-text {
    margin-top: 20px;
    color: var(--text-light);
    font-size: 1.1em;
}

/* Invite Code Display */
.invite-code {
    background: rgba(102, 126, 234, 0.2);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.invite-code-value {
    font-size: 1.8em;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 3px;
    color: var(--primary);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-muted);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 20px;
}

.badge-admin {
    background: rgba(102, 126, 234, 0.3);
    color: var(--primary);
}

.badge-teacher {
    background: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .game-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
    }
}

/* Account Warning Banners */
.account-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.95em;
    animation: bannerPulse 2s ease-in-out infinite;
}

@keyframes bannerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.account-banner.suspended {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.25) 100%);
    border-left: 4px solid #ef4444;
}

.account-banner.restricted {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.25) 100%);
    border-left: 4px solid #f59e0b;
}

.account-banner.inactive {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.25) 0%, rgba(75, 85, 99, 0.25) 100%);
    border-left: 4px solid #6b7280;
}

.account-banner .banner-icon {
    font-size: 1.3em;
}

.account-banner .banner-text {
    flex: 1;
}

.account-banner .banner-text strong {
    color: #fff;
}

.account-banner .banner-text a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.account-banner .banner-text a:hover {
    color: var(--accent);
}

.account-banner.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
    border-left: 4px solid #f59e0b;
}

.account-banner.overage-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(234, 88, 12, 0.25) 100%);
    border-left: 4px solid #ea580c;
}

.account-banner.overage-billing {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(185, 28, 28, 0.2) 100%);
    border-left: 4px solid #dc2626;
}
