/* Modern Teacher Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text {
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    transform: rotate(-5deg);
}

.preview-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.preview-card:nth-child(2) {
    transform: translateY(-1rem);
}

.preview-card:hover {
    transform: translateY(-0.5rem);
}

.preview-card:nth-child(2):hover {
    transform: translateY(-1.5rem);
}

.card-image {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.card-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

/* Features Section */
.features {
    background: white;
    padding: 6rem 2rem;
}

.features-content {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
}

.section-header p {
    font-size: 1.1rem;
    color: #64748b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* How it Works Section */
.how-it-works {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 6rem 2rem;
}

.how-content {
    max-width: 1000px;
    margin: 0 auto;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.step p {
    color: #64748b;
    line-height: 1.6;
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 6rem 2rem;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
    color: white;
}

.cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn.large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.6);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .game-preview {
        grid-template-columns: 1fr;
        transform: none;
    }
    
    .preview-card:nth-child(2) {
        transform: none;
    }
}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-content {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header img {
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #64748b;
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.auth-form input {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fafbfc;
}

.auth-form input:focus {
    outline: none;
    border-color: #10b981;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.auth-switch {
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.auth-switch a {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
}

/* Main Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: 64px 1fr;
    height: 100vh;
    grid-template-areas:
        "sidebar nav"
        "sidebar main";
}

/* Top Navigation */
.top-nav {
    grid-area: nav;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #1e293b;
}

.nav-brand img {
    width: 32px;
    height: 32px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #64748b;
    transition: color 0.2s ease;
}

.user-menu-btn:hover {
    color: #10b981;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 100;
    display: none;
}

.user-menu.show {
    display: block;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    text-decoration: none;
    color: #374151;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-menu a:hover {
    background: #f3f4f6;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: #1e293b;
    border-right: 1px solid #334155;
    overflow-y: auto;
}

.sidebar-menu {
    padding: 1.5rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.menu-item:hover {
    background: rgba(79, 70, 229, 0.1);
    color: #e2e8f0;
}

.menu-item.active {
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
    position: relative;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
}

.menu-item i {
    width: 22px;
    font-size: 1.3rem;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 2rem;
    overflow-y: auto;
    background: #f8fafc;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.section-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.section-actions {
    display: flex;
    gap: 1rem;
}

/* Form Styles */
.game-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
}

.form-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-card-header {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.required-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.form-card-body {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fafbfc;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #10b981;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.form-group small {
    color: #64748b;
    font-size: 0.875rem;
}

.form-help {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f1f5f9;
    border-radius: 12px;
    border-left: 4px solid #10b981;
}

/* Items Grid - 4x4 Layout */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

/* Compact Grid Cards */
.item-card-grid {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
    min-height: 140px;
}

.item-card-grid:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.item-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 auto;
}

.item-card-grid .form-group {
    margin: 0;
}

.item-card-grid input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.item-card-grid input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.image-upload-compact {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.image-upload-compact:hover {
    border-color: #10b981;
    background: #f0f0ff;
}

.image-upload-compact .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #64748b;
}

.image-upload-compact .upload-content i {
    font-size: 1.2rem;
}

.image-upload-compact .upload-content small {
    font-size: 0.75rem;
}

.image-preview-compact {
    display: none;
    max-width: 100%;
}

.image-preview-compact img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Improved Game Cards */
.game-card-improved {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-card-improved:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.game-card-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.game-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.game-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.active-badge {
    background: #10b981;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-meta {
    font-size: 0.875rem;
    color: #64748b;
}

.game-card-body {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.game-description {
    margin: 0 0 1rem 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.game-items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.item-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.item-tag.more {
    background: #e2e8f0;
    color: #64748b;
    font-style: italic;
}

.active-sessions-info {
    background: #f0fdf4;
    color: #059669;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    border-left: 3px solid #10b981;
}

.active-sessions-info i {
    margin-right: 0.5rem;
}

.game-card-actions {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.game-card-actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn.danger:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.btn.success:hover {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
}

/* Legacy card styles (keep for backwards compatibility) */
.item-card {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.item-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.item-header {
    background: white;
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.item-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-upload-area:hover {
    border-color: #10b981;
    background: #f8fafc;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-content i {
    font-size: 2.5rem;
    color: #94a3b8;
}

.upload-content p {
    font-weight: 500;
    color: #64748b;
    margin: 0;
}

.upload-content small {
    color: #94a3b8;
    font-size: 0.875rem;
}

.image-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.75rem;
}

.image-preview .file-info {
    text-align: center;
}

.image-preview .file-name {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.image-preview .file-size {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn.secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Library Filters */
.library-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
}

.filter-select {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    min-width: 200px;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: 64px auto 1fr;
        grid-template-areas:
            "nav"
            "sidebar"
            "main";
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid #334155;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 1rem;
    }
    
    .menu-item {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .auth-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .library-filters {
        flex-direction: column;
    }
}

/* Animation Classes */
.fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slideIn {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #10b981;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 2rem;
}

.shareable-game {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.shareable-game:hover {
    border-color: #10b981;
    background: #f8fafc;
}

.shareable-game-info {
    flex: 1;
}

.shareable-game-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1e293b;
}

.shareable-game-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.shareable-game-items {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shareable-game-item {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #10b981;
}

.share-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
}

.share-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.share-selected-count {
    font-size: 0.9rem;
    color: #64748b;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
}

.empty-share-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.empty-share-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==========================================
   PUBLIC LIBRARY SECTION (No Login Required)
   ========================================== */

.public-library {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.public-library .library-content {
    max-width: 1200px;
    margin: 0 auto;
}

.public-library .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.public-library .section-header h2 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.public-library .section-header p {
    font-size: 1.2rem;
    color: #64748b;
}

.public-library .library-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.public-library .search-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
}

.public-library .search-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.public-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.public-game-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.public-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.public-game-preview {
    height: 140px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    overflow: hidden;
}

.public-game-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.public-game-preview .preview-placeholder {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.public-game-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.public-game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.public-game-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.public-game-meta i {
    margin-right: 0.25rem;
    color: #10b981;
}

.public-game-actions {
    margin-top: auto;
    display: flex;
    gap: 0.75rem;
}

.public-game-actions .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
}

.btn.play-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.btn.play-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn.groups-btn {
    background: white;
    color: #10b981;
    border: 2px solid #10b981;
    font-weight: 600;
}

.btn.groups-btn:hover {
    background: #10b981;
    color: white;
}

.loading-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.loading-games i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #10b981;
}

.no-games-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.no-games-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Game Code Modal for Public Games */
.game-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.game-code-modal.show {
    opacity: 1;
    visibility: visible;
}

.game-code-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.game-code-modal.show .game-code-content {
    transform: scale(1);
}

.game-code-content h2 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.game-code-content .game-title {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.game-code-display {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3em;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.game-code-instructions {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.game-code-instructions h4 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.game-code-instructions ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #64748b;
    font-size: 0.9rem;
}

.game-code-instructions li {
    margin-bottom: 0.25rem;
}

.game-code-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.game-code-buttons .btn {
    padding: 0.75rem 1.5rem;
}

@media (max-width: 768px) {
    .public-library {
        padding: 2rem 1rem;
    }

    .public-library .section-header h2 {
        font-size: 1.75rem;
    }

    .public-games-grid {
        grid-template-columns: 1fr;
    }

    .game-code-display {
        font-size: 1.75rem;
        letter-spacing: 0.2em;
    }
}