/* ============================================================================
   WoW Dark Theme — Trinity Personal Cabinet
   Cataclysm-inspired dark theme with gold accents
   ============================================================================ */

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

/* === Variables === */
:root {
    --bg-dark: #0f0f1a;
    --bg-body: #1a1a2e;
    --bg-card: #1e1e35;
    --bg-card-hover: #252540;
    --bg-input: #12122a;
    --gold: #c9a959;
    --gold-light: #d4b96a;
    --gold-dim: #8a7340;
    --silver: #8a8a8a;
    --bronze: #3d3524;
    --bronze-light: #5a4d38;
    --text: #e0e0e0;
    --text-dim: #888;
    --text-muted: #666;
    --alliance: #3f7fd5;
    --horde: #b30000;
    --error: #c41f3b;
    --error-bg: #3b1520;
    --success: #4caf50;
    --success-bg: #1a3520;
    --font-heading: 'Cinzel', 'Georgia', serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --border-radius: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* === Base === */
body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-body) 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

/* === Navigation === */
header {
    background: var(--bg-dark);
    border-bottom: 2px solid var(--bronze);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(201, 169, 89, 0.3);
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-links a {
    color: var(--silver);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* === Main content === */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* === Footer === */
footer {
    text-align: center;
    padding: 1.2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--bronze);
    background: var(--bg-dark);
}

footer a { color: var(--text-dim); }

/* === Flash messages === */
.flash {
    padding: 0.9rem 1.2rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.flash-error {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: #ff6b7a;
}

.flash-success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: #81c784;
}

/* === Headings === */
h1 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    text-shadow: 0 0 15px rgba(201, 169, 89, 0.2);
}

h2 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

h3 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.1rem;
}

/* === Hero (index page) === */
.hero {
    text-align: center;
    padding: 3rem 0 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 25px rgba(201, 169, 89, 0.3);
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    font-weight: 400;
}

/* === Cards (index) === */
.cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--bronze);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    text-align: center;
    min-width: 200px;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-dim);
}

.card h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.card-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.card-label {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* === Buttons === */
.actions {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.8rem;
    border: 2px solid var(--bronze);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font-body);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--bg-dark);
    border-color: var(--gold);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 89, 0.3);
    color: var(--bg-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--gold);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--gold-dim);
}

/* === Auth forms === */
.auth-form {
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--bronze);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 1.3rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--silver);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--bronze);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 89, 0.15);
}

.auth-form .btn { width: 100%; text-align: center; margin-top: 0.5rem; }

.auth-alt {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* === Info table (account) === */
.info-table {
    width: 100%;
    max-width: 550px;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.info-table th, .info-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(61, 53, 36, 0.5);
}

.info-table th { color: var(--text-dim); width: 45%; font-weight: 500; }
.info-table td { color: var(--text); }

.account-info { margin: 1.5rem 0; }

.account-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* === WoW Class colors === */
.class-warrior     { color: #C79C6E; }
.class-paladin     { color: #F58CBA; }
.class-hunter      { color: #ABD473; }
.class-rogue       { color: #FFF569; }
.class-priest      { color: #FFFFFF; }
.class-deathknight { color: #C41F3B; }
.class-shaman      { color: #0070DE; }
.class-mage        { color: #69CCF0; }
.class-warlock     { color: #9482C9; }
.class-druid       { color: #FF7D0A; }

/* === Character list === */
.char-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
}

.char-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--bronze);
    border-radius: var(--border-radius);
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
    box-shadow: var(--shadow);
}

.char-card:hover {
    border-color: var(--gold-dim);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.char-card.faction-alliance {
    border-left: 4px solid var(--alliance);
}

.char-card.faction-horde {
    border-left: 4px solid var(--horde);
}

.char-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.4rem;
}

.char-level {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--bg-dark);
    font-weight: 700;
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(201, 169, 89, 0.3);
}

.char-name { font-size: 1.15rem; font-weight: 600; }

.badge-online {
    background: var(--success);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.char-info { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0.4rem; }

.char-stats-mini {
    display: flex;
    gap: 1.2rem;
    font-size: 0.85rem;
    color: var(--silver);
}

.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
}

/* === Character detail === */
.char-detail { max-width: 960px; }

.char-detail.faction-alliance { border-top: 3px solid var(--alliance); padding-top: 1rem; }
.char-detail.faction-horde    { border-top: 3px solid var(--horde); padding-top: 1rem; }

.char-detail-header { margin-bottom: 2rem; }

.char-detail-header h1 { font-size: 2.2rem; margin-bottom: 0.3rem; }

.char-subtitle { color: var(--text-dim); font-size: 1.05rem; }

.char-guild {
    color: var(--gold);
    font-size: 1rem;
    margin-top: 0.4rem;
    font-style: italic;
}

.char-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-block {
    background: var(--bg-card);
    border: 1px solid var(--bronze);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
}

.stat-block h3 {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--bronze);
    padding-bottom: 0.5rem;
}

.stat-table { width: 100%; border-collapse: collapse; }

.stat-table th, .stat-table td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    font-size: 0.9rem;
}

.stat-table th { color: var(--text-dim); width: 50%; font-weight: 400; }
.stat-table td { color: var(--text); font-weight: 500; }

.stat-table tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.char-actions { margin-top: 1.5rem; }

/* === Leaderboard === */
.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.leaderboard-tabs a {
    padding: 0.55rem 1.2rem;
    border: 1px solid var(--bronze);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--silver);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.leaderboard-tabs a:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-dim);
    color: var(--gold);
}

.leaderboard-tabs a.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--bg-dark);
    border-color: var(--gold);
    font-weight: 600;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.leaderboard-table thead {
    background: var(--bg-dark);
}

.leaderboard-table th {
    color: var(--gold);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--bronze);
}

.leaderboard-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(42, 42, 62, 0.7);
    font-size: 0.9rem;
}

.leaderboard-table tbody tr {
    background: var(--bg-card);
    transition: background 0.15s;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: rgba(30, 30, 53, 0.7);
}

.leaderboard-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.leaderboard-table .rank {
    color: var(--gold);
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Top 3 ranks styling */
.leaderboard-table tbody tr:nth-child(1) .rank { color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.leaderboard-table tbody tr:nth-child(2) .rank { color: #c0c0c0; text-shadow: 0 0 8px rgba(192, 192, 192, 0.3); }
.leaderboard-table tbody tr:nth-child(3) .rank { color: #cd7f32; text-shadow: 0 0 8px rgba(205, 127, 50, 0.3); }

/* === Connect Page === */
.connect-section {
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.connect-step {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(201, 169, 89, 0.15);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    transition: border-color 0.3s;
}

.connect-step:hover {
    border-color: rgba(201, 169, 89, 0.35);
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--bg-dark);
}

.step-content {
    flex: 1;
}

.step-content h2 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

.step-content p {
    margin-bottom: 0.6rem;
    line-height: 1.7;
}

.download-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-input);
    border: 1px solid rgba(201, 169, 89, 0.25);
    border-radius: var(--border-radius);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}

.download-box-accent {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 169, 89, 0.08), var(--bg-input));
    position: relative;
}

.download-box-accent::after {
    content: 'Рекомендуем';
    position: absolute;
    top: -0.6rem;
    right: 1rem;
    background: var(--gold);
    color: var(--bg-dark);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
}

.download-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.download-title {
    font-weight: 600;
    color: var(--text);
}

.download-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.btn-download {
    white-space: nowrap;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
}

.code-path {
    background: var(--bg-input);
    border: 1px solid rgba(201, 169, 89, 0.15);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin: 0.6rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--gold-light);
    overflow-x: auto;
}

.code-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid rgba(201, 169, 89, 0.25);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    margin: 0.6rem 0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #7fff7f;
}

.btn-copy {
    background: rgba(201, 169, 89, 0.15);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(201, 169, 89, 0.3);
}

.step-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.badge-success {
    display: inline-block;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.tips-box {
    background: var(--bg-input);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}

.tips-box h4 {
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.tips-box ul {
    list-style: none;
    padding: 0;
}

.tips-box li {
    padding: 0.25rem 0;
    padding-left: 1.2rem;
    position: relative;
    color: var(--text-dim);
}

.tips-box li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--gold-dim);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.info-item {
    background: var(--bg-input);
    border-radius: 6px;
    padding: 0.7rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
    color: var(--gold-light);
}

/* === Responsive === */
@media (max-width: 900px) {
    .char-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    nav { flex-direction: column; gap: 0.8rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
    .cards { flex-direction: column; align-items: center; }
    .card { width: 100%; max-width: 320px; }
    .actions { flex-direction: column; align-items: center; }
    .account-actions { flex-direction: column; }
    .hero h1 { font-size: 2rem; }
    .char-detail-grid { grid-template-columns: 1fr; }
    .leaderboard-tabs { flex-wrap: wrap; }
    .leaderboard-table { font-size: 0.85rem; }
    .leaderboard-table th, .leaderboard-table td { padding: 0.5rem 0.6rem; }
    .connect-step { flex-direction: column; gap: 1rem; padding: 1.2rem; }
    .step-number { width: 40px; height: 40px; font-size: 1.1rem; }
    .download-box { flex-direction: column; align-items: stretch; text-align: center; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    .code-block { flex-direction: column; gap: 0.5rem; align-items: stretch; }
}

@media (max-width: 480px) {
    main { padding: 1rem; }
    .auth-form { padding: 1.2rem; }
    .char-stats-mini { flex-wrap: wrap; gap: 0.6rem; }
}
