/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

body.dark {
    background: #1a1a2e;
}

/* ========== HEADER ========== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

body.dark .header {
    background: rgba(26, 26, 46, 0.95);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #6C5CE7;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #6C5CE7;
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    color: #d4a017;
}

body.dark .coin-display {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
}

.coin-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* ========== CONTAINER ========== */
.menu-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== CARDS ========== */
.welcome-card {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: #fff;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.welcome-card p {
    margin: 5px 0;
}

.user-id {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ========== MENU GRID ========== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.menu-item {
    background: #fff;
    padding: 16px;
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(108, 92, 231, 0.08);
    -webkit-user-select: none;
    user-select: none;
}

body.dark .menu-item {
    background: #16213e;
    border-color: rgba(255,255,255,0.1);
}

.menu-item:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.menu-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.menu-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

body.dark .menu-title {
    color: #fff;
}

/* ========== FORMS ========== */
.form-container {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body.dark .form-container {
    background: #16213e;
}

.form-container h3 {
    margin-bottom: 15px;
    color: #6C5CE7;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: #fafafa;
}

body.dark input, 
body.dark select, 
body.dark textarea {
    background: #0f3460;
    border-color: #16213e;
    color: #fff;
}

input:focus {
    border-color: #6C5CE7;
    outline: none;
    background: #fff;
}

/* ========== BUTTONS ========== */
.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
    font-family: inherit;
}

.btn:active {
    opacity: 0.85;
}

.btn-outline {
    background: transparent;
    border: 2px solid #6C5CE7;
    color: #6C5CE7;
}

body.dark .btn-outline {
    color: #a29bfe;
    border-color: #a29bfe;
}

/* ========== NOTIFICATION ========== */
.notification {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 10px;
    color: #fff;
    z-index: 999;
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.success { background: #00b894; }
.error { background: #e74c3c; }
.info { background: #3498db; }

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 400px) {
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .logo {
        width: 32px;
        height: 32px;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    .menu-item {
        padding: 14px;
    }
}

/* ========== وضعیت اشتراک در هدر ========== */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.subscription-container {
    display: inline-block;
}

.subscription-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.subscription-badge.premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.subscription-badge.normal {
    background: rgba(108, 92, 231, 0.15);
    color: #6C5CE7;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

body.dark .subscription-badge.normal {
    background: rgba(108, 92, 231, 0.25);
    color: #a29bfe;
    border-color: rgba(162, 155, 254, 0.4);
}

@media (max-width: 450px) {
    .welcome-header {
        flex-direction: column;
        text-align: center;
    }
    .subscription-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
}

/* ========== استایل‌های ویترین کانال ========== */
/* ویترین هدر */
.showcase-header {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    padding: 20px 16px;
    border-radius: 0 0 30px 30px;
    color: white;
    margin-bottom: 16px;
    text-align: center;
}

.showcase-header h1 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.showcase-header p {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* باکس جستجو */
.showcase-search {
    background: white;
    margin: -12px 16px 20px 16px;
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.showcase-search i {
    color: #6C5CE7;
    font-size: 1.2rem;
}

.showcase-search input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    background: transparent;
    padding: 10px 0;
    margin: 0;
}

body.dark .showcase-search {
    background: #16213e;
}

body.dark .showcase-search input {
    color: #fff;
}

/* دسته‌بندی‌ها */
.showcase-categories {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 16px 15px 16px;
    scrollbar-width: none;
    margin-bottom: 8px;
}

.showcase-categories::-webkit-scrollbar {
    display: none;
}

.showcase-cat-btn {
    background: white;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
}

body.dark .showcase-cat-btn {
    background: #16213e;
    color: #fff;
}

.showcase-cat-btn.active {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

/* کارت‌های کانال */
.showcase-channel-card {
    background: white;
    border-radius: 20px;
    margin-bottom: 16px;
    padding: 16px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    align-items: flex-start;
}

body.dark .showcase-channel-card {
    background: #16213e;
}

.showcase-channel-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.showcase-avatar {
    width: 70px;
    min-width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.showcase-avatar-img {
    width: 70px;
    min-width: 70px;
    height: 70px;
    border-radius: 20px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.showcase-avatar-wrapper {
    width: 70px;
    min-width: 70px;
    height: 70px;
    border-radius: 20px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
}

.showcase-avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    position: absolute;
    top: 0;
    left: 0;
}

.showcase-info {
    flex: 1;
    min-width: 0;
}

.showcase-name {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #333;
}

body.dark .showcase-name {
    color: #fff;
}

.showcase-verified {
    background: #00b894;
    color: white;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.showcase-featured {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #2c3e50;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.showcase-category {
    font-size: 0.7rem;
    color: #6C5CE7;
    margin-bottom: 5px;
}

.showcase-description {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .showcase-description {
    color: #aaa;
}

.showcase-stats {
    display: flex;
    gap: 12px;
    font-size: 0.7rem;
    color: #888;
    flex-wrap: wrap;
}

.showcase-stats i {
    margin-left: 3px;
}

.showcase-rating-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.showcase-stars {
    display: flex;
    gap: 3px;
}

.showcase-stars i {
    font-size: 0.8rem;
    color: #ddd;
}

.showcase-rating-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6C5CE7;
}

.showcase-loading {
    text-align: center;
    padding: 40px;
}

.showcase-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #6C5CE7;
    border-radius: 50%;
    animation: showcase-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes showcase-spin {
    to { transform: rotate(360deg); }
}

.showcase-empty {
    text-align: center;
    padding: 50px 20px;
    color: #888;
}

.showcase-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

.showcase-hint {
    text-align: center;
    padding: 10px;
    background: #f0f0f0;
    margin: 10px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    color: #666;
}

body.dark .showcase-hint {
    background: #0f3460;
    color: #aaa;
}

@media (max-width: 450px) {
    .showcase-avatar,
    .showcase-avatar-wrapper {
        width: 55px;
        min-width: 55px;
        height: 55px;
    }
    .showcase-avatar-fallback {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }
    .showcase-name {
        font-size: 0.9rem;
    }
    .showcase-stars i {
        font-size: 0.7rem;
    }
}