/* Multi Platform Shop - Persian RTL UI */

:root {
    --bg-primary: #0b1220;
    --bg-secondary: #111a2e;
    --bg-tertiary: #16223a;
    --bg-card: #162033;
    --border: #1f2c45;
    --text-primary: #e6ecf7;
    --text-secondary: #8b9dc3;
    --text-muted: #6878a0;
    --accent: #0ea5e9;
    --accent-2: #06b6d4;
    --accent-soft: rgba(14, 165, 233, 0.12);
    --amber: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #f43f5e;
}

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

html, body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.7;
}

body {
    background-image:
        radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 100%, rgba(244, 63, 94, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
input, textarea, select, button { font-family: inherit; }

/* ===== AUTH ===== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    justify-content: center;
}
.auth-logo .mark {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 24px;
    color: white;
}
.auth-logo .name { font-size: 24px; font-weight: 700; }
.auth-title { font-size: 20px; font-weight: 600; text-align: center; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-secondary); text-align: center; margin-bottom: 28px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--text-secondary); font-size: 14px; }
.auth-foot a { color: var(--accent); font-weight: 600; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(14, 165, 233,0.4); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card); }
.btn-danger {
    background: rgba(244, 63, 94, 0.12);
    color: var(--error);
    border: 1px solid rgba(244, 63, 94, 0.3);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

/* ===== ALERTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid;
}
.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); color: var(--success); }
.alert-error   { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.3); color: var(--error); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: var(--warning); }

/* ===== LAYOUT ===== */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.brand-mark {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: white;
}
.brand-name { font-size: 18px; font-weight: 700; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 16px; }
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    margin-bottom: 10px;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: white;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-plan { font-size: 11px; color: var(--text-muted); }

.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13px;
    transition: all 0.15s;
}
.logout-btn:hover { color: var(--error); background: rgba(244, 63, 94, 0.08); }

.main { padding: 32px 40px; overflow-x: auto; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
}
.stat-label { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ===== SHOP CARDS ===== */
.shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}
.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.2s;
    display: block;
}
.shop-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.shop-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 14px;
}
.shop-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }

.shop-bots-mini {
    display: flex;
    gap: 6px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.bot-mini {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.shop-stats {
    display: flex;
    gap: 16px;
    margin: 14px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.shop-stat { flex: 1; text-align: center; }
.shop-stat .v { font-size: 18px; font-weight: 700; }
.shop-stat .l { font-size: 11px; color: var(--text-muted); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 16px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-text { color: var(--text-secondary); margin-bottom: 16px; }

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 700; }

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-error   { background: rgba(244, 63, 94, 0.15); color: var(--error); }
.badge-info    { background: var(--accent-soft); color: var(--accent); }

/* ===== TABLE ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 12px 14px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    background: var(--bg-tertiary);
}
.table tbody tr:hover { background: var(--bg-tertiary); }

/* ===== PRODUCT GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.product-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.product-image { width: 100%; height: 140px; object-fit: cover; }
.product-image-placeholder {
    width: 100%;
    height: 140px;
    background: var(--bg-secondary);
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 32px;
}
.product-body { padding: 14px; }
.product-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.product-price { color: var(--accent); font-weight: 700; }
.product-cat { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.product-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ===== INFO BOX ===== */
.info-box {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.8;
}
.info-box code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.tab {
    padding: 12px 18px;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    font-weight: 500;
    font-size: 14px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== PLATFORM SELECTOR ===== */
.platform-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.platform-option { cursor: pointer; display: block; }
.platform-option input[type="radio"] { display: none; }
.platform-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}
.platform-card:hover { border-color: var(--accent); }
.platform-option input[type="radio"]:checked + .platform-card {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.platform-icon { font-size: 36px; }
.platform-info { flex: 1; }
.platform-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.platform-features { display: flex; gap: 6px; flex-wrap: wrap; }
.feature-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.feature-tag.success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.feature-tag.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.platform-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: grid;
    place-items: center;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}
.platform-option input[type="radio"]:checked + .platform-card .platform-check { opacity: 1; }

/* ===== BOTS LIST ===== */
.bots-list { display: flex; flex-direction: column; gap: 10px; }
.bot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}
.bot-icon { font-size: 24px; }
.bot-info { flex: 1; }
.bot-platform { font-size: 13px; color: var(--text-secondary); }
.bot-username { font-size: 14px; font-weight: 600; color: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .main { padding: 20px; }
}

/* ===== UTILS ===== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
