/**
 * AI Arena – Frontend CSS
 *
 * Design system: Scoped Premium Compact UI with Dynamic Animated Rows.
 * Optimized for JS-driven inertial scrolling and 4K screens.
 *
 * @package AI_Arena
 */

/* ══════════════════════════════════════════
   ARENA SCOPED ROOT
   ══════════════════════════════════════════ */

.arena-app-layout {
    all: initial;
    display: flex;
    background: #ffffff;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
}

.arena-app-layout * { box-sizing: border-box; }

/* ══════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════ */
.arena-sidebar {
    width: 68px;
    min-width: 68px;
    background: #f5f5f7;
    border-right: 1px solid #d2d2d7;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 100;
}

.arena-sidebar:hover { width: 240px; box-shadow: 10px 0 30px rgba(0,0,0,0.05); }

.sidebar-inner { display: flex; flex-direction: column; height: 100%; width: 240px; }

.sidebar-top {
    padding: 0;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    width: 68px;
}

.sidebar-brand-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 0.85;
    color: #1d1d1f;
}

.brand-ai { font-size: 28px; font-weight: 900; letter-spacing: -0.05em; }
.brand-arena { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: #86868b; }

.sidebar-nav { flex: 1; padding: 15px 12px; overflow-y: auto; width: 240px; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    text-decoration: none;
    color: #515154;
    gap: 15px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover { background: #e8e8ed; color: #1d1d1f; }
.nav-item.active { background: #ffffff; color: #1d1d1f; box-shadow: 0 4px 12px rgba(0,0,0,0.08); font-weight: 700; }

.nav-icon { display: flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; color: inherit; }
.nav-icon svg { width: 20px !important; height: 20px !important; stroke-width: 2px; }

.nav-label { font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; visibility: hidden; }
.arena-sidebar:hover .nav-label { opacity: 1; visibility: visible; }

.nav-divider { height: 1px; background: rgba(0,0,0,0.08); margin: 15px 10px; width: 216px; }
.nav-section-title { font-size: 10px; font-weight: 700; color: #b0b0b5; text-transform: uppercase; letter-spacing: 0.1em; padding: 0 12px 8px; white-space: nowrap; opacity: 0; visibility: hidden; }
.arena-sidebar:hover .nav-section-title { opacity: 1; visibility: visible; }

/* ══════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════ */
.arena-main {
    flex: 1;
    background: #ffffff;
    overflow-x: hidden;
}

.arena-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px 10px;
}

.arena-dashboard-header h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; color: #1d1d1f; letter-spacing: -0.03em; }
.arena-dashboard-header p { color: #86868b; font-size: 14px; margin: 0; }

.btn-animated-gradient {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient-flow 10s ease infinite;
    color: #fff !important;
    border: none;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-v4-primary { padding: 10px 24px; border-radius: 980px; font-weight: 700; text-decoration: none; transition: 0.2s; font-size: 13px; }
.btn-v4-primary:hover { transform: scale(1.05); }

/* ══════════════════════════════════════════
   DYNAMIC ROWS (JS DRIVEN)
   ══════════════════════════════════════════ */
.arena-dynamic-rows { padding: 10px 0 40px; width: 100%; overflow: hidden; }

.arena-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 4px;
    background: #fff;
    width: 100%;
}

/* Left Square Model Card */
.row-model-card {
    flex: 0 0 120px;
    height: 120px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #f2f2f7;
    border-bottom: 1px solid #f2f2f7;
    z-index: 10;
    position: relative;
    padding: 10px;
    text-align: center;
    box-shadow: 10px 0 20px rgba(0,0,0,0.02);
}

.row-rank-chip {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #1d1d1f;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.row-model-logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: #f5f5f7; margin-bottom: 8px; }
.row-model-logo img { width: 100%; height: 100%; object-fit: cover; }

.row-model-info h3 { font-size: 12px; font-weight: 700; margin: 0 0 2px; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100px; }
.row-elo { font-size: 10px; font-weight: 700; color: #86868b; }

/* Right Carousel Viewport */
.row-carousel-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    cursor: grab;
    background: #fbfbfd;
    border-bottom: 1px solid #f2f2f7;
    user-select: none;
    white-space: nowrap;
}
.row-carousel-viewport:active { cursor: grabbing; }

.row-carousel-track {
    display: inline-flex;
    gap: 6px;
    padding: 10px 6px;
    will-change: transform;
}

/* CAROUSEL ITEM - 16:9 FULL IMAGE */
.carousel-item-card {
    flex: 0 0 178px;
    height: 100px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s ease;
}

.carousel-item-card:hover { transform: scale(1.05); z-index: 5; }

.item-media { width: 100%; height: 100%; background-size: cover; background-position: center; pointer-events: none; }

.item-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(29,29,31,0.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-item-card:hover .item-hover-overlay { opacity: 1; }

.hover-title { color: #fff; font-size: 11px; font-weight: 600; text-align: center; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Footer CTA */
.arena-footer-cta { padding: 60px 50px; background: #fff; text-align: center; }
.cta-inner-v4 { max-width: 800px; margin: 0 auto; background: #f5f5f7; color: #1d1d1f; padding: 60px; border-radius: 32px; border: 1px solid #d2d2d7; }
.cta-inner-v4 h2 { font-size: 32px; font-weight: 800; margin-bottom: 12px; color: #1d1d1f; letter-spacing: -0.02em; }
.cta-inner-v4 p { font-size: 18px; color: #86868b; margin-bottom: 30px; line-height: 1.4; }
.btn-v4-big { display: inline-block; padding: 16px 40px; border-radius: 980px; font-weight: 700; text-decoration: none; transition: 0.2s; font-size: 16px; }

@media (max-width: 768px) { .arena-sidebar { display: none; } }

/* Legacy Compat Tokens */
:root { --accent-blue: #0066cc; }
