/* ═══════════════════════════════════════════
   ALADDIN CASINO — Arabian Gold Theme
   ═══════════════════════════════════════════ */

:root {
    --gold: #d4a017;
    --gold-light: #f0d060;
    --gold-dark: #8b6914;
    --purple: #1a0a2e;
    --purple-mid: #2d1b4e;
    --purple-light: #3d2b5e;
    --red: #c0392b;
    --green: #27ae60;
    --bg: #0d0618;
    --card-bg: rgba(26, 10, 46, 0.95);
    --text: #e8d5b0;
    --text-dim: #8a7a60;
    --border: rgba(212, 160, 23, 0.3);
}

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

body {
    font-family: 'Reem Kufi', 'Amiri', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Login Page ─────────────────────────── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a0a2e 0%, #0d0618 70%);
    background-image:
        radial-gradient(ellipse at 50% 50%, rgba(212, 160, 23, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at center, #1a0a2e 0%, #0d0618 70%);
}

.login-overlay {
    position: fixed;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" x="50" text-anchor="middle" font-size="80" opacity="0.03">&#9733;</text></svg>');
    background-size: 120px;
    pointer-events: none;
}

.login-container {
    position: relative;
    width: 380px;
    padding: 40px 30px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(212, 160, 23, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.lamp-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-family: 'Amiri', serif;
    font-size: 36px;
    color: var(--gold);
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(212, 160, 23, 0.4);
}

.login-logo .subtitle {
    font-size: 14px;
    letter-spacing: 12px;
    color: var(--gold-dark);
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.input-group {
    margin-bottom: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.15);
}

.input-group input::placeholder {
    color: var(--text-dim);
}

.btn-gold {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    border: none;
    border-radius: 8px;
    color: #1a0a2e;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(212, 160, 23, 0.4);
}

.btn-gold:active {
    transform: translateY(0);
}

.form-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    min-height: 18px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-dim);
    font-size: 13px;
}

/* ─── Navbar ─────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-family: 'Amiri', serif;
    font-size: 20px;
    color: var(--gold);
    letter-spacing: 4px;
}

.nav-center {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    padding: 4px 0;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -14px;
    background: var(--red);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 160, 23, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.coin-icon {
    font-size: 16px;
}

#balance {
    color: var(--gold-light);
    font-weight: 700;
    font-size: 15px;
}

.username-display {
    color: var(--text-dim);
    font-size: 13px;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ─── Music Toggle ───────────────────────── */

.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    z-index: 200;
    transition: all 0.3s;
}

.music-toggle.playing {
    color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.3);
}

/* ─── Slot Machine ───────────────────────── */

.slot-container {
    display: flex;
    justify-content: center;
    padding: 30px 20px;
}

.slot-frame {
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 0 40px rgba(212, 160, 23, 0.08);
}

.slot-header {
    text-align: center;
    margin-bottom: 20px;
}

.slot-header h2 {
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: 22px;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(212, 160, 23, 0.3);
}

.slot-machine {
    position: relative;
    background: linear-gradient(180deg, #0a0416, #150a28);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 20px;
}

.reels-container {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.reel {
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.reel-strip {
    position: absolute;
    width: 100%;
    transition: transform 0.1s ease;
}

.symbol {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
}

.payline {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    height: 2px;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    opacity: 0.5;
    pointer-events: none;
}

/* Win display */
.win-display {
    text-align: center;
    padding: 12px;
    margin-bottom: 16px;
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid var(--gold);
    border-radius: 8px;
    animation: winPulse 0.5s ease-in-out;
}

.win-display span {
    color: var(--gold-light);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.bet-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-bet {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--purple-mid);
    border: 1px solid var(--border);
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-bet:hover {
    background: var(--purple-light);
    border-color: var(--gold);
}

.bet-display {
    text-align: center;
    min-width: 70px;
}

.bet-label {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 2px;
}

#bet-amount {
    font-size: 20px;
    color: var(--gold-light);
    font-weight: 700;
}

.btn-spin {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    border: 3px solid var(--gold-light);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.3);
}

.btn-spin:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 160, 23, 0.5);
}

.btn-spin:active {
    transform: scale(0.98);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.spin-text {
    font-family: 'Amiri', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--purple);
    letter-spacing: 2px;
}

.btn-max-bet {
    padding: 8px 14px;
    background: var(--purple-mid);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--gold);
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-max-bet:hover {
    background: var(--purple-light);
    border-color: var(--gold);
}

/* Paytable */
.paytable {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.paytable h3 {
    text-align: center;
    color: var(--gold-dark);
    font-size: 13px;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.paytable-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.pay-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 13px;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.pay-row span:last-child {
    color: var(--gold);
    font-weight: 700;
}

/* ─── Spinning Animation ─────────────────── */

.reel.spinning .reel-strip {
    animation: reelSpin 0.15s linear infinite;
}

@keyframes reelSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-120px); }
}

/* ─── Leaderboard ────────────────────────── */

.leaderboard-container {
    display: flex;
    justify-content: center;
    padding: 30px 20px;
}

.leaderboard-frame {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.leaderboard-frame h2 {
    text-align: center;
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: 22px;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.lb-row:hover {
    background: rgba(212, 160, 23, 0.05);
}

.lb-rank {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    margin-right: 14px;
}

.lb-rank.gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--purple);
}

.lb-rank.silver {
    background: linear-gradient(135deg, #888, #ccc);
    color: var(--purple);
}

.lb-rank.bronze {
    background: linear-gradient(135deg, #8b4513, #cd853f);
    color: white;
}

.lb-rank.normal {
    background: var(--purple-mid);
    color: var(--text-dim);
}

.lb-name {
    flex: 1;
    font-size: 15px;
}

.lb-profit {
    font-weight: 700;
    font-size: 15px;
}

.lb-profit.positive {
    color: var(--green);
}

.lb-profit.negative {
    color: var(--red);
}

.lb-profit.zero {
    color: var(--text-dim);
}

/* ─── Contacts & Chat ────────────────────── */

.contacts-container {
    display: flex;
    height: calc(100vh - 56px);
}

.contacts-sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
}

.contacts-sidebar h3 {
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.contact-item:hover {
    background: var(--purple-mid);
}

.contact-item.active {
    background: var(--purple-light);
    border: 1px solid var(--border);
}

.contact-name {
    font-size: 14px;
}

.contact-balance {
    font-size: 12px;
    color: var(--text-dim);
}

/* Chat area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
}

.chat-header-name {
    font-size: 16px;
    color: var(--gold);
}

.btn-request-coins {
    padding: 6px 14px;
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--gold);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-request-coins:hover {
    background: rgba(212, 160, 23, 0.2);
    border-color: var(--gold);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.msg.mine {
    align-self: flex-end;
    background: var(--purple-light);
    border: 1px solid var(--border);
}

.msg.theirs {
    align-self: flex-start;
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid var(--border);
}

.msg.coin-request {
    border-color: var(--gold);
    background: rgba(212, 160, 23, 0.1);
}

.coin-request-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-approve, .btn-reject {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.btn-approve {
    background: var(--green);
    color: white;
}

.btn-reject {
    background: var(--red);
    color: white;
}

.coin-status {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 700;
}

.coin-status.approved { color: var(--green); }
.coin-status.rejected { color: var(--red); }
.coin-status.pending { color: var(--gold); }

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.chat-input input:focus {
    border-color: var(--gold);
}

.chat-input button {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border: none;
    border-radius: 8px;
    color: var(--purple);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-input button:hover {
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 320px;
}

.modal h3 {
    color: var(--gold);
    margin-bottom: 16px;
    font-size: 16px;
}

.modal input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
}

.modal-actions .btn-cancel {
    background: var(--purple-mid);
    color: var(--text-dim);
}

.modal-actions .btn-confirm {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--purple);
    font-weight: 700;
}

/* ─── Utilities ──────────────────────────── */

.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-dim);
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
    }

    .nav-center {
        gap: 12px;
    }

    .slot-frame {
        padding: 16px;
    }

    .reel {
        width: 90px;
        height: 90px;
    }

    .symbol {
        height: 90px;
        font-size: 42px;
    }

    .btn-spin {
        width: 80px;
        height: 80px;
    }

    .contacts-container {
        flex-direction: column;
    }

    .contacts-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .paytable-grid {
        grid-template-columns: 1fr;
    }
}
