/* ========== ریست ساده ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1b1638 0, #050513 45%, #000 100%);
    color: #f5f5ff;
    direction: rtl;
    overflow-x: hidden;
}

/* ========== پس‌زمینه نئونی متحرک ========== */

.background-glow {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 0, rgba(155,92,255,0.35), transparent 60%),
        radial-gradient(circle at 85% 80%, rgba(0,255,156,0.25), transparent 55%),
        radial-gradient(circle at 50% 120%, rgba(0,150,255,0.18), transparent 55%);
    pointer-events: none;
    z-index: -1;
    animation: bgMove 24s ease-in-out infinite alternate;
}

@keyframes bgMove {
    0% {
        transform: translate(0,0) scale(1);
        filter: hue-rotate(0deg);
    }
    100% {
        transform: translate(-40px, 20px) scale(1.05);
        filter: hue-rotate(25deg);
    }
}

/* ========== هدر بالا ========== */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: rgba(4,4,12,0.94);
    border-bottom: 1px solid rgba(140,140,230,0.5);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.logo-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo {
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 1.2rem;
}

.logo span {
    color: #9b5cff;
}

.logo-sub {
    font-size: 0.75rem;
    color: #b8b8e5;
}

.top-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stat-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: radial-gradient(circle at top, #25244a, #101022);
    border: 1px solid rgba(130,130,220,0.6);
    font-size: 0.8rem;
    box-shadow: 0 0 14px rgba(0,0,0,0.9);
}

/* ========== نوار ابزار مارکت ========== */

.market-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 22px 10px;
    font-size: 0.8rem;
    background: linear-gradient(90deg, rgba(10,10,26,0.95), rgba(6,6,18,0.95));
    border-bottom: 1px solid rgba(110,110,200,0.35);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.toolbar-title {
    color: #d0d0ff;
    font-size: 0.8rem;
}

.toolbar-btn {
    border: none;
    outline: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    background: rgba(20,20,40,0.9);
    color: #e0e0ff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.toolbar-btn:hover {
    background: rgba(45,45,90,0.95);
    box-shadow: 0 0 12px rgba(155,92,255,0.7);
    transform: translateY(-1px);
}

.toolbar-btn.active {
    background: linear-gradient(135deg, #9b5cff, #00ff9c);
    color: #050508;
    box-shadow: 0 0 16px rgba(155,92,255,0.9);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a8a8e8;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #00ff9c;
    box-shadow: 0 0 8px rgba(0,255,156,0.9);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* ========== لایه اصلی ========== */

.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 16px;
    padding: 16px 22px 30px;
}

.column-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.column-title.small {
    font-size: 0.9rem;
}

.column-subtitle {
    font-size: 0.8rem;
    color: #b8b8e5;
    margin-bottom: 10px;
}

.column {
    min-width: 0;
}

/* ریسپانسیو برای تبلت/موبایل */

@media (max-width: 1050px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* ========== کارت‌های مارکت ========== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.asset-card {
    position: relative;
    background: radial-gradient(circle at top, #232341, #070712);
    border-radius: 14px;
    padding: 10px;
    border: 1px solid rgba(145,130,255,0.25);
    box-shadow: 0 0 20px rgba(0,0,0,0.85);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.asset-card::before {
    content: "";
    position: absolute;
    inset: -50%;
    background:
        radial-gradient(circle at 0 0, rgba(155,92,255,0.25), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(0,255,156,0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.asset-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 0 30px rgba(155,92,255,0.7);
    border-color: rgba(155,92,255,0.7);
    background: radial-gradient(circle at top, #2c2854, #080818);
}

.asset-card:hover::before {
    opacity: 1;
}

.asset-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
}

.asset-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.asset-owner {
    font-size: 0.75rem;
    color: #aaaad8;
    margin-bottom: 6px;
}

.asset-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.price-tag {
    font-weight: 600;
}

.change-tag {
    font-size: 0.8rem;
}

.change-pos {
    color: #00ff9c;
}

.change-neg {
    color: #ff4b6a;
}

.asset-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 4px;
    opacity: 0.85;
}

.asset-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.status-dot.sale-on {
    background: #00ff9c;
    box-shadow: 0 0 8px rgba(0,255,156,0.9);
}

.status-dot.sale-off {
    background: #999;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}

/* ========== پنل‌ها ========== */

.panel-block {
    background: rgba(7,7,18,0.96);
    border-radius: 16px;
    padding: 13px 14px 14px;
    border: 1px solid rgba(130,130,220,0.45);
    box-shadow: 0 0 25px rgba(0,0,0,0.9);
    margin-bottom: 14px;
}

/* کوئست */

.quest-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: radial-gradient(circle at top, #2f2857, #0b0b1b);
    border-color: rgba(255,215,0,0.6);
}

.quest-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd700, #ff9b2f);
    color: #2b1a00;
    font-size: 0.75rem;
    font-weight: 700;
}

.quest-text {
    font-size: 0.8rem;
    color: #f9f5d8;
}

/* فرم ساخت آیتم */

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.8rem;
    color: #dcdcff;
}

.form-vertical input[type="text"],
.form-vertical input[type="number"],
.form-vertical textarea {
    background: rgba(10,10,24,0.96);
    border: 1px solid rgba(140,140,230,0.7);
    border-radius: 8px;
    padding: 8px 10px;
    color: #f5f5ff;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.form-vertical input:focus,
.form-vertical textarea:focus {
    border-color: #9b5cff;
    box-shadow: 0 0 10px rgba(155,92,255,0.7);
    transform: translateY(-1px);
}

.form-vertical textarea {
    min-height: 64px;
    resize: vertical;
}

/* آپلود فایل */

.file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: radial-gradient(circle at top, #262447, #121224);
    border: 1px dashed rgba(155,92,255,0.8);
    font-size: 0.8rem;
    cursor: pointer;
    color: #e3e3ff;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.file-label:hover {
    background: radial-gradient(circle at top, #312a66, #15152c);
    box-shadow: 0 0 16px rgba(155,92,255,0.7);
    transform: translateY(-1px);
}

.file-label input {
    display: none;
}

/* دکمه‌ها */

.btn-primary,
.btn-secondary {
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 7px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #9b5cff, #00ff9c);
    color: #050507;
    box-shadow: 0 0 18px rgba(155,92,255,0.8);
}

.btn-secondary {
    background: rgba(40,40,80,0.95);
    color: #f5f5ff;
    box-shadow: 0 0 10px rgba(0,0,0,0.9);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.96);
    box-shadow: 0 0 8px rgba(0,0,0,0.9);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

.full-width {
    width: 100%;
}

/* پیام فرم */

.form-msg {
    font-size: 0.78rem;
    min-height: 16px;
    margin-top: 4px;
}

.form-msg.error {
    color: #ff4b6a;
}

.form-msg.ok {
    color: #00ff9c;
}

/* پورتفو */

#portfolioList {
    font-size: 0.82rem;
}

.portfolio-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(120,120,200,0.4);
    align-items: center;
}

.portfolio-item-name {
    flex: 1;
    margin-left: 6px;
}

.portfolio-item-value {
    white-space: nowrap;
}

/* نمودارها */

.chart-container {
    position: relative;
    width: 100%;
    height: 180px;
}

.chart-container.big {
    height: 220px;
}

/* ========== مودال ورود ========== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(5,5,18,0.97), rgba(0,0,0,0.98));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal {
    background: radial-gradient(circle at top, #181733, #05050c);
    border-radius: 18px;
    padding: 18px 18px 16px;
    width: 320px;
    max-width: 90vw;
    border: 1px solid rgba(155,92,255,0.7);
    box-shadow: 0 0 45px rgba(0,0,0,0.9);
    text-align: center;
    animation: modalPop 0.3s ease-out;
}

.modal-login h2 {
    margin-bottom: 8px;
}

.modal-login p {
    font-size: 0.86rem;
    color: #c0c0ff;
    margin-bottom: 12px;
}

.modal-login input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(155,92,255,0.6);
    background: rgba(10,10,22,0.95);
    color: #f5f5ff;
    margin-bottom: 10px;
}

@keyframes modalPop {
    from { transform: scale(0.85) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ========== پنل اسلایدی جزئیات آیتم ========== */

.asset-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 430px;
    transform: translateX(100%);
    background: linear-gradient(135deg, rgba(10,10,28,0.98), rgba(5,5,16,0.98));
    border-left: 1px solid rgba(150,150,250,0.4);
    box-shadow: -8px 0 24px rgba(0,0,0,0.9);
    z-index: 40;
    transition: transform 0.25s ease-out;
}

.asset-panel.open {
    transform: translateX(0);
}

.asset-panel-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
}

.panel-close {
    align-self: flex-start;
    border: none;
    background: transparent;
    color: #f5f5ff;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 4px;
}

.asset-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.asset-panel-main {
    flex: 1;
    min-width: 0;
}

.asset-panel-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.asset-panel-owner {
    font-size: 0.8rem;
    color: #b8b8e5;
    margin-bottom: 3px;
}

.asset-panel-price {
    font-size: 0.85rem;
    color: #00ff9c;
    margin-bottom: 2px;
}

.asset-panel-change {
    font-size: 0.78rem;
}

.asset-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asset-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ریسپانسیو پنل آیتم */

@media (max-width: 600px) {
    .asset-panel {
        max-width: 100%;
    }
}

/* ========== Toast پیام پایین صفحه ========== */

.toast {
    position: fixed;
    bottom: 16px;
    right: 16px;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: rgba(10,10,20,0.97);
    border: 1px solid rgba(155,92,255,0.7);
    box-shadow: 0 0 26px rgba(0,0,0,0.95);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 60;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========== ریسپانسیو کلی برای موبایل ========== */

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .top-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .market-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .main-layout {
        padding: 12px 10px 24px;
    }

    .panel-block {
        padding: 12px 10px;
    }
}
