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

:root {
    --bg-dark: #09090b;
    --bg-surface: #0d0d11;
    --bg-card: #121216;
    --bg-card-hover: #18181e;
    --border: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    --text-subtle: #71717a;
    --accent: #fafafa;
    --accent-contrast: #09090b;
    --success: #4ade80;
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-border: rgba(34, 197, 94, 0.25);
    --error: #f87171;
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: rgba(239, 68, 68, 0.25);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

iconify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    line-height: 1;
}

/* Navbar */
.navbar {
    height: 60px;
    width: 100%;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
}

.logo-brand img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.badge-tag {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 7px 11px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.badge-coin {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 5px 11px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.badge-coin:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.07);
}

.admin-pill {
    color: #facc15 !important;
    border: 1px solid rgba(250, 204, 21, 0.3) !important;
    background: rgba(250, 204, 21, 0.08) !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.btn-primary {
    background: #fafafa;
    color: #09090b;
    border-color: #fafafa;
}

.btn-primary:hover {
    background: #e4e4e7;
    border-color: #e4e4e7;
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

/* Home Page Background */
body.home-page {
    background:
        linear-gradient(rgba(9, 9, 11, 0.68), rgba(9, 9, 11, 0.88) 60%, rgba(9, 9, 11, 0.98)),
        url('bosh_sahifa.png') no-repeat center top / cover fixed;
    background-color: var(--bg-dark);
}

body.home-page .navbar {
    background: rgba(9, 9, 11, 0.78);
}

body.home-page .card {
    background: rgba(13, 13, 17, 0.76);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

body.home-page .card:hover {
    background: rgba(18, 18, 22, 0.86);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Hero Section */
.hero {
    max-width: 860px;
    margin: 72px auto 48px;
    text-align: center;
    padding: 0 24px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    font-size: 0.78rem;
    color: var(--text-primary);
    margin-bottom: 22px;
    font-weight: 500;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: #ffffff;
}

.hero-title span {
    color: var(--text-muted);
}

.hero-subtitle {
    font-size: 1.02rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Stats Banner */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 44px;
    text-align: center;
}

.stats-banner-item {
    background: rgba(13, 13, 17, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 16px 12px;
}

.stats-banner-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-banner-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
}

@media (max-width: 680px) {
    .stats-banner {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: 2rem;
    }
}

/* Feature Cards & Steps */
.feature-card {
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 14px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: #fafafa;
    color: #09090b;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-item b {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 3px;
}

.step-item p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 24px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    transition: border-color 0.15s ease;
}

.card:hover {
    border-color: var(--border-hover);
}

.card h2, .card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Auth Pages */
.auth-box {
    max-width: 400px;
    width: 100%;
    margin: 56px auto;
    padding: 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header img {
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
}

.auth-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: #71717a;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Alerts */
.alert {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.84rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

/* Dashboard */
.dashboard-container {
    max-width: 1040px;
    margin: 28px auto;
    padding: 0 24px;
    width: 100%;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar-frame {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #18181b;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-frame canvas,
.user-avatar-frame img {
    image-rendering: pixelated;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

.model-radio-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.model-radio-card input {
    accent-color: #fafafa;
}

.model-radio-card.active {
    border-color: #a1a1aa;
    background: rgba(255, 255, 255, 0.07);
    font-weight: 500;
}

.upload-area {
    border: 1px dashed var(--border-hover);
    border-radius: 8px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover, .upload-area.dragover {
    border-color: #fafafa;
    background: rgba(255, 255, 255, 0.05);
}

/* Character Front & Back Stage */
.character-preview-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.character-pose-box {
    background: #09090b;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pose-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.character-pose-box canvas {
    image-rendering: pixelated;
    width: 96px;
    height: 192px;
}

/* Shop & Filter Chips */
.filter-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.filter-chip.active {
    background: #fafafa;
    color: #09090b;
    border-color: #fafafa;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.cape-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.15s ease, transform 0.15s ease;
    position: relative;
}

.cape-card:hover {
    border-color: var(--border-hover);
}

.cape-card.equipped {
    border-color: rgba(34, 197, 94, 0.45);
}

.cape-preview-frame {
    width: 90px;
    height: 144px;
    background: #09090b;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.cape-preview-frame canvas {
    width: 72px;
    height: 116px;
    image-rendering: pixelated;
}

.badge-equipped {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    border: 1px solid var(--success-border);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.price-tag {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0 12px 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Admin */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.stat-num {
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-top: 4px;
}

.table-container {
    overflow-x: auto;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.825rem;
    vertical-align: middle;
}

th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.badge-banned {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error-border);
}

/* Responsive Nav & Media Queries */
@media (max-width: 992px) {
    .nav-container {
        padding: 0 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-container::-webkit-scrollbar {
        display: none;
    }
    .nav-links {
        gap: 4px;
    }
    .nav-link {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    animation: modalFadeIn 0.16s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.reason-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.reason-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.1);
}

/* User avatar badge */
.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    text-align: center;
    color: var(--text-subtle);
    font-size: 0.8rem;
}

/* Global Announcement Banners */
.announcement-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.45;
    border: 1px solid var(--border);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.announcement-banner.announcement-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.announcement-banner.announcement-warning {
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.3);
    color: #fde047;
}
