/* ============================================================================
   Game Dashboard Styles
   ============================================================================
   Phase 1 (v9.0.0) — Gamification v2
   Matches admin-dashboard.html styling patterns.
   ============================================================================ */

/* Layout */
body {
    background-color: #f4f4f4;
    display: flex;
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* Sidebar */
.dashboard-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #ddd;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-brand h2 {
    font-family: 'Bodoni Moda', serif;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0;
}

.sidebar-nav {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #f0f0f0;
}

.nav-link.active {
    background: #f0f0f0;
    font-weight: 600;
    color: #000;
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.user-badge {
    font-size: 0.8rem;
    color: #666;
}

.role-badge {
    display: inline-block;
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 6px;
    text-transform: uppercase;
}

/* Main Content */
.dashboard-main {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    position: relative;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header h1 {
    font-family: 'Bodoni Moda', serif;
    font-size: 1.6rem;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

/* Buttons */
.btn-action {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    background: #e8e8e8;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.game-table {
    width: 100%;
    border-collapse: collapse;
}

.game-table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    border-bottom: 1px solid #eee;
}

.game-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}

.game-table tr:hover td {
    background: #fafafa;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 3rem !important;
    font-style: italic;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-status {
    background: #e8e8e8;
    color: #555;
}

.badge-draft { background: #fff3cd; color: #856404; }
.badge-scheduled { background: #cce5ff; color: #004085; }
.badge-active { background: #d4edda; color: #155724; }
.badge-completed { background: #e2e3e5; color: #383d41; }
.badge-archived { background: #f8d7da; color: #721c24; }

.badge-type {
    background: #e8e8e8;
    color: #555;
}

.badge-public { background: #d4edda; color: #155724; }
.badge-private { background: #fff3cd; color: #856404; }

/* Action buttons in table */
.action-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Forms */
.game-form {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    max-width: 800px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.settings-panel {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.settings-panel legend {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 8px;
    color: #333;
}

.sub-settings {
    margin-top: 0.5rem;
    padding: 0.8rem;
    background: #fafafa;
    border-radius: 6px;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Detail Header */
.detail-header {
    margin-bottom: 1.5rem;
}

.detail-header h2 {
    font-family: 'Bodoni Moda', serif;
    font-size: 1.4rem;
    margin: 0 0 6px;
}

.detail-meta {
    display: flex;
    gap: 6px;
}

.instance-actions {
    margin-bottom: 1rem;
}

/* Participants Panel */
.participants-panel {
    margin-top: 2rem;
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.participants-panel h3 {
    font-size: 1rem;
    margin: 0 0 1rem;
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 1rem;
}

.pagination-bar button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.pagination-bar button.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.pagination-bar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastIn 0.3s ease;
    max-width: 350px;
}

.toast-success { background: #28a745; }
.toast-error { background: #dc3545; }
.toast-info { background: #17a2b8; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-sidebar {
        width: 220px;
        padding: 1rem;
    }
    .dashboard-main {
        margin-left: 220px;
        padding: 1rem;
    }
    .form-row {
        flex-direction: column;
    }
    .header-actions {
        width: 100%;
    }
}
