/* ═══════════════════════════════════════════════════════════════
   KradreCombats — Game UI Stylesheet
   Dark RPG theme inspired by the original OriginalCombats game
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-dark: #0d0d1a;
    --bg-panel: #151528;
    --bg-card: #1a1a35;
    --bg-input: #12122a;
    --bg-hover: #222245;
    --border: #2a2a50;
    --border-light: #3a3a60;
    --border-gold: #8b7532;
    --text: #c8c8d8;
    --text-dim: #7878a0;
    --text-bright: #e8e8f0;
    --gold: #d4a832;
    --gold-dim: #8b7532;
    --red: #c83030;
    --red-bright: #e84040;
    --green: #30a840;
    --green-bright: #40d050;
    --blue: #3060c8;
    --blue-bright: #4080e8;
    --mana: #4060d0;
    --energy: #c89020;
    --hp-bar: #a83030;
    --mp-bar: #3050a8;
    --en-bar: #a88020;
    --link: #8090d0;
    --link-hover: #a0b0f0;
    --accent: #c04050;
    --header-bg: #0a0a18;
    --sidebar-bg: #101025;
    --footer-bg: #0a0a15;
    --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); text-decoration: underline; }

img { max-width: 100%; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Form Elements ────────────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="search"],
select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-bright);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold-dim);
}
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}
.form-control { width: 100%; }
.form-control-sm { width: auto; padding: 5px 8px; font-size: 0.85rem; }
.form-error { color: var(--red-bright); font-size: 0.85rem; margin-top: 3px; display: block; }
.radio-group { display: flex; gap: 16px; margin-top: 4px; }
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.inline-form { display: inline; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn, button[type="submit"], input[type="submit"] {
    display: inline-block;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-bright);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--font);
    transition: all 0.15s;
    text-decoration: none;
}
.btn:hover, button[type="submit"]:hover { background: var(--bg-hover); border-color: var(--gold-dim); color: var(--gold); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-bright); border-color: var(--blue-bright); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-bright); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-link { background: none; border: none; color: var(--link); cursor: pointer; padding: 0; font-size: inherit; }
.btn-link:hover { color: var(--link-hover); text-decoration: underline; }
.btn-logout { color: var(--red); font-size: 0.85rem; margin-left: 10px; }
.btn-logout:hover { color: var(--red-bright); }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; border: 1px solid; font-size: 0.9rem; }
.alert ul { padding-left: 18px; list-style: disc; }
.alert-success { background: rgba(48, 168, 64, 0.15); border-color: var(--green); color: var(--green-bright); }
.alert-error { background: rgba(200, 48, 48, 0.15); border-color: var(--red); color: var(--red-bright); }

/* ── Badge ────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.75rem; font-weight: 600; }
.badge-vip { background: var(--gold); color: #000; }
.badge-clan { background: var(--blue); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   GAME LAYOUT — Header / Sidebar / Content / Footer
   ═══════════════════════════════════════════════════════════════ */

.game-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────── */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--header-bg);
    border-bottom: 2px solid var(--border-gold);
    padding: 0 20px;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-logo a {
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
}
.header-logo a:hover { color: var(--gold); text-decoration: none; }
.header-nav { display: flex; gap: 4px; }
.header-nav a {
    padding: 6px 14px;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.15s;
}
.header-nav a:hover { background: var(--bg-hover); color: var(--text-bright); text-decoration: none; }
.header-user { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.user-gold { color: var(--gold); font-weight: 600; }
.user-login { color: var(--text-bright); font-weight: 500; }

/* ── Body: Sidebar + Content ──────────────────────────────────── */
.game-body {
    display: flex;
    flex: 1;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.game-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    overflow-y: auto;
}
.sidebar-user-info {
    padding: 0 14px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.user-name { color: var(--text-bright); font-weight: 600; font-size: 1rem; }
.user-level { color: var(--gold-dim); font-size: 0.85rem; margin-top: 2px; }
.user-city { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-nav a {
    padding: 8px 18px;
    color: var(--text);
    font-size: 0.9rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
    border-left-color: var(--gold-dim);
    text-decoration: none;
}
.sidebar-nav .nav-admin { color: var(--red); }
.sidebar-nav .nav-admin:hover { color: var(--red-bright); border-left-color: var(--red); }

/* ── Main Content ─────────────────────────────────────────────── */
.game-content {
    flex: 1;
    padding: 20px 24px;
    min-height: calc(100vh - 90px);
}
.game-content h2 {
    color: var(--gold);
    font-size: 1.3rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.game-content h3 {
    color: var(--text-bright);
    font-size: 1.05rem;
    margin: 18px 0 10px;
}

/* ── Footer ───────────────────────────────────────────────────── */
.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 8px 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES — Login / Register
   ═══════════════════════════════════════════════════════════════ */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0a0a20 50%, #0d0820 100%);
}
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo h1 { font-size: 1.8rem; }
.auth-logo h1 a { color: var(--gold); text-decoration: none; }
.auth-logo h1 a:hover { text-decoration: none; }

.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.auth-card h2 {
    text-align: center;
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.3rem;
}
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-dim); font-size: 0.8rem; }
.auth-footer a { color: var(--link); }

/* ═══════════════════════════════════════════════════════════════
   GAME PAGES — Inventory, Skills, Profile, Friends, Quests
   ═══════════════════════════════════════════════════════════════ */

/* ── Inventory ────────────────────────────────────────────────── */
.inventory-layout { display: flex; gap: 20px; }
.equipment-panel {
    width: 280px;
    min-width: 280px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
}
.equipment-panel h3 { margin-top: 0; color: var(--gold); }
.equipment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}
.equipment-item .slot-label { color: var(--text-dim); font-size: 0.75rem; margin-right: 8px; }
.equipment-item .item-name { flex: 1; color: var(--text-bright); }

.inventory-panel { flex: 1; }
.inventory-panel h3 { color: var(--gold); margin-top: 0; }
.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.15s;
}
.item-row:hover { border-color: var(--border-light); }
.item-row .item-name { flex: 1; color: var(--text-bright); font-size: 0.9rem; }
.item-actions { display: flex; gap: 4px; }

/* ── Profile ──────────────────────────────────────────────────── */
.profile-layout { display: flex; gap: 20px; flex-wrap: wrap; }
.profile-avatar-panel {
    width: 200px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    text-align: center;
}
.profile-avatar img { width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--border-gold); }
.profile-badges { margin-top: 10px; }
.profile-stats-panel {
    flex: 1;
    min-width: 250px;
}
.profile-stats, .profile-records {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 10px;
}
.profile-stats td:first-child, .profile-records td:first-child { color: var(--text-dim); width: 40%; }
.profile-stats td:last-child, .profile-records td:last-child { color: var(--text-bright); font-weight: 500; }
.profile-bio-panel {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
}
.bio-content { color: var(--text); font-size: 0.9rem; line-height: 1.6; }
.profile-equipment, .profile-effects {
    margin-top: 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
}

/* ── Friends ──────────────────────────────────────────────────── */
.friends-view h3 { color: var(--gold); }
.friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* ── Skills ───────────────────────────────────────────────────── */
.skills-view table {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* ── Quests ───────────────────────────────────────────────────── */
.quest-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.quest-item .quest-name { color: var(--text-bright); font-weight: 500; }
.quest-item .quest-info { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   LOCATION PAGES — Shop, Bank, Arena, Auction, Dungeon
   ═══════════════════════════════════════════════════════════════ */
.location-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PAGES
   ═══════════════════════════════════════════════════════════════ */
.admin-view { }
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    text-align: center;
}
.stat-label { display: block; color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-value { display: block; color: var(--gold); font-size: 1.6rem; font-weight: 700; }

.admin-actions { margin-bottom: 20px; }
.admin-user-search { margin-bottom: 20px; }
.admin-user-search .inline-form { display: flex; gap: 8px; }
.admin-user-search input { flex: 1; }
.admin-users-table {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.admin-users-table tr:hover { background: var(--bg-hover); }

/* ═══════════════════════════════════════════════════════════════
   BATTLE PAGES
   ═══════════════════════════════════════════════════════════════ */
.battle-view { }
.battle-teams { display: flex; gap: 20px; justify-content: center; margin-bottom: 20px; }
.battle-team {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    min-width: 250px;
}
.battle-log {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .game-body { flex-direction: column; }
    .game-sidebar { width: 100%; min-width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 0; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 0 10px; }
    .sidebar-nav a { padding: 6px 10px; border-left: none; border-bottom: 2px solid transparent; }
    .sidebar-nav a:hover { border-left-color: transparent; border-bottom-color: var(--gold-dim); }
    .header-nav { display: none; }
    .inventory-layout { flex-direction: column; }
    .equipment-panel { width: 100%; min-width: 100%; }
    .profile-layout { flex-direction: column; }
    .profile-avatar-panel { width: 100%; }
    .battle-teams { flex-direction: column; }
}
