/* ======================================
   AZIEL DESIGN SYSTEM V2.5
   Shared Theme Foundation
====================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* =========================
   BRAND / TOKENS
========================= */

:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --transition: var(--motion-duration-normal, .25s) var(--motion-ease-standard, ease);

    --az-container: 1180px;
    --az-page-x: 92%;
    --az-header-h: 78px;
}

/* =========================
   DARK / LIGHT VARIABLES
========================= */

body.theme-dark {
    --bg: #070b1d;
    --bg-soft: #0c1224;
    --surface: rgba(255, 255, 255, .055);
    --surface-strong: #10182f;
    --card: rgba(255, 255, 255, .06);
    --card-hover: rgba(255, 255, 255, .09);
    --border: rgba(255, 255, 255, .09);

    --text: #ffffff;
    --text-secondary: #b7c0d4;
    --text-muted: #8a93a8;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, .18);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, .28);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .38);
}

body.theme-light {
    --bg: #f5f6fb;
    --bg-soft: #eef1f7;
    --surface: rgba(255, 255, 255, .78);
    --surface-strong: #ffffff;
    --card: rgba(255, 255, 255, .86);
    --card-hover: #ffffff;
    --border: rgba(17, 24, 39, .10);

    --text: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;

    --shadow-sm: 0 4px 12px rgba(17, 24, 39, .06);
    --shadow-md: 0 12px 28px rgba(17, 24, 39, .10);
    --shadow-lg: 0 24px 60px rgba(17, 24, 39, .14);
}

/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body.theme-light {
    color-scheme: light;
}

body.theme-dark {
    color-scheme: dark;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background .3s ease, color .3s ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

/* =========================
   TYPOGRAPHY
========================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

small {
    color: var(--text-muted);
}

label {
    color: var(--text-secondary);
}

/* =========================
   LAYOUT
========================= */

.container,
.az-container {
    width: min(var(--az-container), var(--az-page-x));
    margin-left: auto;
    margin-right: auto;
}

#mainHome,
.wallet-page,
.account-layout {
    width: min(var(--az-container), var(--az-page-x)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.section {
    margin-top: 80px;
}

/* =========================
   CARD
========================= */

.card,
.az-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

/* =========================
   BUTTONS
========================= */

.btn {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 800;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(124, 58, 237, .32);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--card-hover);
}

/* =========================
   INPUTS
========================= */

.input,
input,
textarea,
select {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.input {
    width: 100%;
    height: 56px;
    border-radius: var(--radius-md);
    padding: 0 18px;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(139, 92, 246, .65);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
}

/* =========================
   BADGE
========================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .15);
    border: 1px solid rgba(139, 92, 246, .25);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

/* =========================
   TOPBAR ACTIONS
========================= */

.az-topbar-actions button {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .10);
    color: var(--primary);
    border: 1px solid rgba(124, 58, 237, .14);
}

/* =========================
   LOCALE SWITCHER
========================= */

.az-locale-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.az-locale-switcher select {
    height: 38px;
    min-width: 92px;
    padding: 0 10px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    outline: none;
    cursor: pointer;
}

.az-locale-switcher select option {
    color: #111827;
    background: #ffffff;
}

/* =========================
   LOCALE MODAL
========================= */

.az-locale-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 15, 25, .46);
    backdrop-filter: blur(18px);
}

.az-locale-modal.show {
    display: flex;
}

.az-locale-box {
    width: min(440px, 100%);
    padding: 28px;
    border-radius: 30px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.az-locale-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(124, 58, 237, .10);
    color: var(--primary);
    font-size: 22px;
    cursor: pointer;
}

.az-locale-box h2 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 950;
    letter-spacing: -1px;
    color: var(--text);
}

.az-locale-box p {
    margin: 0 0 22px;
    color: var(--text-muted);
    font-size: 14px;
}

.az-locale-box label {
    display: block;
    margin: 16px 0 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 900;
}

.az-locale-box select {
    width: 100%;
    height: 54px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0 14px;
    font-weight: 850;
    outline: none;
}

.az-locale-save {
    width: 100%;
    height: 54px;
    margin-top: 24px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    font-weight: 950;
    cursor: pointer;
}

/* =========================
   COMMON PAGE BACKGROUND
========================= */

.az-home,
.az-page,
main {
    background: transparent;
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, .35);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, .55);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    :root {
        --az-header-h: 66px;
    }

    #mainHome,
    .wallet-page,
    .account-layout {
        width: calc(100% - 32px) !important;
    }

    .az-locale-switcher {
        gap: 6px;
    }

    .az-locale-switcher select {
        min-width: 74px;
        height: 34px;
        font-size: 12px;
        padding: 0 6px;
    }
}

/* =========================
   THEME VISIBILITY SAFETY
========================= */

body.theme-light {
    --heading: #111827;
    --page-bg: #f5f6fb;
    --input-bg: rgba(255, 255, 255, .86);
    --input-text: #111827;
    --soft-panel: rgba(255, 255, 255, .82);
}

body.theme-dark {
    --heading: #ffffff;
    --page-bg: #070b1d;
    --input-bg: rgba(255, 255, 255, .06);
    --input-text: #ffffff;
    --soft-panel: rgba(255, 255, 255, .06);
}

body,
main,
section,
div {
    color: var(--text);
}

h1,
h2,
h3,
h4,
strong {
    color: var(--heading, var(--text));
}

input,
textarea,
select {
    background: var(--input-bg);
    color: var(--input-text);
}

.content-card,
.form-card,
.account-content,
.account-sidebar,
.az-panel,
.trust-card,
.popular-game-card,
.security-card {
    color: var(--text);
}

.content-card p,
.form-card p,
.account-content p,
.security-card p {
    color: var(--text-secondary);
}
