/* ============================================
   MODERN LAYOUT - X/Facebook Style
   Sidebar Navigation + Timeline Feed
   ============================================ */

/* === APP WRAPPER LAYOUT === */
.app-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Hide old top bar when sidebar is active */
.top-bar { display: none !important; }
.app-container { padding: 0; margin: 0; }

/* === LEFT SIDEBAR === */
.sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.sidebar-logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Current Game Pill in Sidebar */
.sidebar-game-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 12px;
    background: var(--accent-dim);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: default;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-game-pill .pulse-dot {
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-align: left;
    position: relative;
}

.sidebar-nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-nav-item.active {
    color: var(--accent);
    background: var(--accent-dim);
    font-weight: 600;
}

/* New Game Button */
.sidebar-action {
    padding: 12px;
}

.sidebar-action .btn {
    width: 100%;
    justify-content: center;
}
/* === PROFILE SECTION IN SIDEBAR === */
.sidebar-profile {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.profile-card-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.profile-card-mini:hover {
    background: var(--bg-hover);
}

.profile-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.profile-mini-info {
    flex: 1;
    min-width: 0;
}

.profile-mini-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-mini-handle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.profile-mini-chevron {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Profile Expanded Panel */
.sidebar-profile-panel {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: viewFadeIn 0.2s ease;
}

.sidebar-profile-panel.open {
    display: flex;
}

/* Profile Stats Row */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.profile-stat {
    text-align: center;
}

.profile-stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.profile-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.profile-action-btn.danger:hover {
    color: var(--red);
}

.profile-action-btn i {
    width: 18px;
    text-align: center;
}
/* === MAIN CONTENT === */
.main-content {
    overflow-y: auto;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* === TIMELINE / FEED VIEW === */
.feed-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* Feed Header */
.feed-header {
    padding: 20px 24px;
    margin-bottom: 16px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.feed-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.feed-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-header h2 i { color: var(--accent); }

.feed-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Profile Banner in Feed */
.feed-profile-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.banner-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid var(--accent);
}

.banner-info { flex: 1; }

.banner-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.banner-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.banner-stats {
    display: flex;
    gap: 20px;
}

.banner-stat {
    text-align: center;
}

.banner-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

.banner-stat-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
/* === GAME CARDS (Timeline Posts) === */
.games-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    animation: viewFadeIn 0.3s ease;
}

.game-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Card Header */
.gc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.gc-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.gc-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gc-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.gc-options {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
}

.gc-options:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Card Body */
.gc-body {
    padding: 0 16px 14px;
}

.gc-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.gc-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gc-meta i {
    color: var(--accent);
    font-size: 0.8rem;
}

/* Score */
.gc-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 14px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.gc-team {
    text-align: center;
    min-width: 80px;
}

.gc-team-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.gc-team-score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.gc-vs {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
/* Decision Stats */
.gc-decisions {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.gc-dec {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.gc-dec i { font-size: 0.85rem; }

.gc-dec-correct i { color: var(--green); }
.gc-dec-wrong i { color: var(--red); }
.gc-dec-missed i { color: var(--yellow); }

/* Tags */
.gc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gc-tag {
    padding: 3px 9px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Card Actions */
.gc-actions {
    display: flex;
    border-top: 1px solid var(--border);
}

.gc-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.gc-action:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.gc-action:not(:last-child) {
    border-right: 1px solid var(--border);
}

/* Empty State */
.feed-empty {
    text-align: center;
    padding: 60px 20px;
}

.feed-empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.feed-empty h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.feed-empty p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
/* === RESPONSIVE === */
@media (max-width: 1100px) {
    .app-wrapper { grid-template-columns: 64px 1fr; }
    .sidebar-logo-text,
    .sidebar-nav-item span,
    .sidebar-game-pill span,
    .profile-mini-info,
    .profile-mini-chevron,
    .sidebar-profile-panel { display: none !important; }
    .sidebar-nav-item { justify-content: center; padding: 12px 8px; }
    .sidebar-action .btn span { display: none; }
    .sidebar-action .btn i { margin: 0; }
    .sidebar-header { justify-content: center; }
    .sidebar-logo { justify-content: center; }
    .profile-card-mini { justify-content: center; padding: 10px; }
}

@media (max-width: 768px) {
    .app-wrapper { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -280px;
        width: 260px;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    }
    .sidebar.open { left: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 49;
    }
    .sidebar-overlay.open { display: block; }
    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 48;
    }
    .mobile-bar-btn {
        background: none;
        border: none;
        color: var(--accent);
        font-size: 1.2rem;
        cursor: pointer;
    }
    .mobile-bar-title {
        font-size: 1rem;
        font-weight: 600;
        background: linear-gradient(135deg, var(--accent), var(--teal));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    .feed-container { padding: 12px 12px 60px; }
}

/* Hide mobile bar on desktop */
@media (min-width: 769px) {
    .mobile-bar { display: none !important; }
    .sidebar-overlay { display: none !important; }
}
