/* ══════════════════════════════════════
   🦈 SharkMC - Sea Glass Theme
   ══════════════════════════════════════ */

/* ─── ریشه و متغیرهای تم ─── */
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #3b82f6;
    --font: 'Segoe UI', Tahoma, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #c7d2fe 100%);
    --bg-secondary: rgba(255, 255, 255, 0.55);
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-input: rgba(255, 255, 255, 0.7);
    --bg-header: rgba(255, 255, 255, 0.6);
    --bg-admin: rgba(220, 38, 38, 0.08);
    --bg-chat-me: linear-gradient(135deg, #0ea5e9, #06b6d4);
    --bg-chat-other: rgba(255, 255, 255, 0.7);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --border: rgba(14, 165, 233, 0.2);
    --border-strong: rgba(14, 165, 233, 0.35);
    --hover: rgba(14, 165, 233, 0.08);
    --scrollbar-track: rgba(186, 230, 253, 0.5);
    --scrollbar-thumb: rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0c1222 0%, #0f172a 50%, #0e1a2b 100%);
    --bg-secondary: rgba(15, 23, 42, 0.65);
    --bg-card: rgba(15, 23, 42, 0.55);
    --bg-input: rgba(30, 41, 59, 0.6);
    --bg-header: rgba(15, 23, 42, 0.75);
    --bg-admin: rgba(220, 38, 38, 0.1);
    --bg-chat-me: linear-gradient(135deg, #0369a1, #0e7490);
    --bg-chat-other: rgba(30, 41, 59, 0.6);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --border: rgba(14, 165, 233, 0.15);
    --border-strong: rgba(14, 165, 233, 0.25);
    --hover: rgba(14, 165, 233, 0.1);
    --scrollbar-track: rgba(15, 23, 42, 0.5);
    --scrollbar-thumb: rgba(14, 165, 233, 0.25);
}

/* ─── ریست پایه ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    direction: rtl;
    transition: background 0.5s ease;
}

/* ─── اسکرولبار ─── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ─── انیمیشن‌ها ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ─── لینک‌ها ─── */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

/* ─── هدر ─── */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header .container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.header-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-nav a,
.header-nav button {
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    text-decoration: none;
}

.header-nav a:hover,
.header-nav button:hover {
    background: var(--hover);
    color: var(--primary);
}

.header-nav a.active {
    background: var(--hover);
    color: var(--primary);
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* هدر ادمین */
.header-admin .header {
    border-bottom-color: rgba(220, 38, 38, 0.25);
}

.header-admin .header-logo .logo-icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.header-admin .header-nav a.active,
.header-admin .header-nav a:hover {
    color: #ef4444;
    background: rgba(220, 38, 38, 0.08);
}

/* منوی موبایل */
.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 65px;
        right: 0;
        left: 0;
        background: var(--bg-header);
        backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow);
        animation: slideDown 0.3s ease;
    }

    .header-nav.show {
        display: flex;
    }

    .header-nav a,
    .header-nav button {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }
}

/* ─── کانتینر ─── */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {

    min-height: calc(100vh - 65px - 80px);
    animation: fadeIn 0.5s ease;
}

/* ─── کارت شیشه‌ای ─── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

/* ─── گرید ─── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ─── تایپوگرافی ─── */
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .title-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

/* ─── فرم‌ها ─── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    padding-left: 36px;
}

/* ─── دکمه‌ها ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(14, 165, 233, 0.5);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.35);
}

.btn-success:hover {
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--hover);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-xs);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── بنر صفحه اصلی ─── */
.hero {
    text-align: center;
    padding: 80px 20px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat .number {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
}

.hero-stat .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ─── ویژگی‌ها ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.3s;
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(6, 182, 212, 0.15));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 1px solid var(--border);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── فرم لاگین / رجیستر ─── */
.auth-container {
    max-width: 440px;
    margin: 40px auto;
}

.auth-container .glass-card {
    animation: scaleIn 0.4s ease;
}

.auth-container h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 28px;
    color: var(--primary);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ─── چت ─── */
.chat-container {
    display: flex;
    height: calc(100vh - 65px);
    overflow: hidden;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}

.chat-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-online {
    font-size: 0.78rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 75%;
    animation: fadeInUp 0.3s ease;
}

.chat-message.mine {
    flex-direction: row-reverse;
    margin-right: auto;
}

.chat-message.other {
    margin-left: auto;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.msg-content {
    background: var(--bg-chat-other);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 14px;
    border-top-right-radius: 4px;
    position: relative;
}

.chat-message.mine .msg-content {
    background: var(--bg-chat-me);
    color: white;
    border-color: transparent;
    border-top-right-radius: 14px;
    border-top-left-radius: 4px;
}

.msg-sender {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.chat-message.mine .msg-sender {
    color: rgba(255, 255, 255, 0.8);
}

.msg-text {
    font-size: 0.92rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.msg-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-message.mine .msg-time {
    color: rgba(255, 255, 255, 0.6);
    justify-content: flex-end;
}

.msg-reply {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-right: 3px solid var(--primary);
    margin-bottom: 6px;
    border-radius: 4px;
    background: rgba(14, 165, 233, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
}

.chat-message.mine .msg-reply {
    background: rgba(255, 255, 255, 0.15);
    border-right-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.8);
}

.msg-media {
    max-width: 280px;
    max-height: 220px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: block;
}

.msg-media.video {
    max-width: 320px;
    max-height: 250px;
}

.msg-media.audio {
    max-width: 300px;
    height: 42px;
}

.msg-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(14, 165, 233, 0.08);
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.chat-message.mine .msg-file {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.msg-file:hover {
    background: rgba(14, 165, 233, 0.15);
}

.msg-reply-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0;
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.msg-content:hover .msg-reply-btn {
    opacity: 1;
}

.chat-message.mine .msg-reply-btn {
    left: auto;
    right: 8px;
    color: rgba(255, 255, 255, 0.5);
}

.chat-message.mine .msg-content:hover .msg-reply-btn {
    color: rgba(255, 255, 255, 0.9);
}

/* پنل پاسخ */
.reply-panel {
    display: none;
    padding: 10px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-right: 3px solid var(--primary);
    animation: slideDown 0.2s ease;
}

.reply-panel.show {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-panel .reply-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.reply-panel .reply-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ورودی چت */
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}

.chat-attach-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.attach-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--hover);
}

.attach-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.chat-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-row input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.chat-input-row input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.chat-send-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* پنل ایموجی و گیف */
.emoji-panel,
.gif-panel {
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    animation: scaleIn 0.2s ease;
}

.emoji-panel.show,
.gif-panel.show {
    display: block;
}

.emoji-panel img {
    width: 36px;
    height: 36px;
    margin: 4px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    padding: 2px;
}

.emoji-panel img:hover {
    background: var(--hover);
    transform: scale(1.2);
}

.gif-panel img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin: 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.gif-panel img:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow);
}

/* ─── پروفایل ─── */
.profile-header {
    text-align: center;
    padding: 40px 20px;
}

.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.profile-avatar-wrap img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.3);
}

.profile-avatar-wrap label {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.profile-avatar-wrap label:hover {
    transform: scale(1.1);
}

.profile-avatar-wrap input {
    display: none;
}

/* ─── فروشگاه ─── */
.shop-rank-card {
    text-align: center;
    overflow: hidden;
    padding: 0;
}

.shop-rank-card .rank-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.shop-rank-card .rank-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-rank-card .rank-body {
    padding: 22px;
}

.shop-rank-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.shop-rank-card .rank-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.shop-rank-card .rank-price {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 16px;
}

/* ─── جدول ─── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-input);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--hover);
}

.table td img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

/* ─── بج وضعیت ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-primary {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ─── تیکت‌ها ─── */
.ticket-card {
    margin-bottom: 16px;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.ticket-header h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.ticket-body {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.ticket-image {
    max-width: 300px;
    border-radius: var(--radius-xs);
    margin-bottom: 12px;
}

.ticket-reply {
    margin-top: 16px;
    padding: 16px;
    background: rgba(14, 165, 233, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    border-right: 3px solid var(--primary);
}

.ticket-reply h4 {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.ticket-reply p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ─── دانلودها ─── */
.download-card {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
}

.download-card .dl-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.download-card .dl-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.download-card .dl-info {
    flex: 1;
}

.download-card .dl-info h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.download-card .dl-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.dl-meta {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── پنل ادمین ─── */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - 65px);
}

.admin-sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    padding: 24px 16px;
}

.admin-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    text-align: right;
    text-decoration: none;
    margin-bottom: 4px;
}

.admin-sidebar .nav-item:hover,
.admin-sidebar .nav-item.active {
    background: var(--hover);
    color: var(--primary);
}

.admin-main {
    padding: 28px;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
        position: fixed;
        top: 65px;
        right: 0;
        bottom: 0;
        width: 280px;
        z-index: 999;
        box-shadow: var(--shadow-lg);
    }

    .admin-sidebar.show {
        display: block;
    }

    .admin-mobile-toggle {
        display: block !important;
    }
}

.admin-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
}

/* ─── آمار ادمین ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 22px;
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── تایمر شمارش معکوس ─── */
.countdown {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.countdown-active {
    color: var(--success);
}

.countdown-expired {
    color: var(--warning);
}

/* ─── فوتر ─── */
.footer {
    padding: 28px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

/* ─── ابزارها ─── */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.gap-10 {
    gap: 10px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.inline-flex {
    display: inline-flex;
}

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.nothing {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.nothing .nothing-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.5;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 450px;
    width: 100%;
    animation: scaleIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-box h3 {
    margin-bottom: 14px;
}

.modal-box .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ─── ریسپانسیو نهایی ─── */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero {
        padding: 50px 16px;
    }

    .glass-card {
        padding: 20px;
    }

    .container {
        padding: 0 16px;
    }

    .main-content {
        padding: 20px 0;
    }

    .chat-message {
        max-width: 90%;
    }

    .chat-messages {
        padding: 14px;
    }

    .chat-input-area {
        padding: 12px 14px;
    }

    .download-card {
        flex-direction: column;
        text-align: center;
    }

    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}