/* ==================== assets/css/style.css ==================== */
/* قالب Google Drive - دو زبانه (RTL/LTR) */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg: #ffffff; --bg-alt: #f8f9fa; --card: #ffffff;
    --border: #e8eaed; --border-soft: #f1f3f4;
    --text: #202124; --text-2: #5f6368; --text-3: #80868b;
    --accent: #1a73e8; --accent-hover: #1765cc; --accent-soft: #e8f0fe;
    --danger: #d93025; --success: #188038; --warn: #f9ab00;
    --shadow-sm: 0 1px 2px rgba(60,64,67,.1);
    --shadow-md: 0 1px 3px rgba(60,64,67,.15), 0 4px 8px rgba(60,64,67,.1);
}

html { background: #fff; }

body {
    font-family: 'Google Sans', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Tahoma, sans-serif;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 40px;
    transition: background .2s;
}

body[dir="rtl"] { font-family: 'Vazirmatn', 'Google Sans', Tahoma, sans-serif; }

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; }

/* ========== TOPBAR ========== */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.topbar-inner {
    max-width: 1400px; margin: 0 auto; padding: 0 16px;
    height: 64px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 20px; color: var(--text); flex-shrink: 0; }
.brand-logo { height: 40px; width: auto; max-width: 120px; object-fit: contain; display: block; }
.brand-logo-fallback {
    display: none; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff; font-weight: 700; font-size: 15px;
    border-radius: 10px; width: 40px; height: 40px;
}
.brand-name { font-weight: 500; color: var(--text-2); font-size: 18px; }

.search-wrap { flex: 1; max-width: 720px; position: relative; }
.search-input {
    width: 100%; padding: 12px 48px 12px 20px;
    background: var(--bg-alt); border: 1px solid transparent;
    border-radius: 24px; font-family: inherit; font-size: 15px;
    color: var(--text); transition: .15s;
}
body[dir="ltr"] .search-input { padding: 12px 20px 12px 48px; }
.search-input:focus { outline: none; background: var(--card); border-color: var(--border); box-shadow: var(--shadow-md); }
.search-icon {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-2); pointer-events: none;
}
body[dir="ltr"] .search-icon { right: auto; left: 16px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); transition: .15s;
}
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn svg { width: 22px; height: 22px; }

.user-avatar-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff; font-weight: 600; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid transparent; transition: .15s;
}
.user-avatar-btn:hover { border-color: var(--accent-soft); }
.user-avatar-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ========== USER DROPDOWN ========== */
.user-dropdown {
    position: absolute; top: 60px; left: 16px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-md);
    min-width: 300px; z-index: 200; padding: 8px 0; display: none;
}
body[dir="ltr"] .user-dropdown { left: auto; right: 16px; }
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 16px; border-bottom: 1px solid var(--border); text-align: center; }
.user-dropdown-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff; font-weight: 600; font-size: 24px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
}
.user-dropdown-name { font-weight: 600; font-size: 15px; color: var(--text); }
.user-dropdown-email { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.user-dropdown-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 20px; font-size: 14px; color: var(--text);
    transition: .15s; cursor: pointer; width: 100%; text-align: inherit;
}
.user-dropdown-item:hover { background: var(--bg-alt); }
.user-dropdown-item svg { width: 20px; height: 20px; color: var(--text-2); flex-shrink: 0; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ========== LAYOUT ========== */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}
.container { max-width: 1400px; margin: 0 auto; padding: 20px 16px; }

/* ========== SIDEBAR ========== */
.sidebar {
    padding: 16px 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    border-radius: 0 24px 24px 0;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
    cursor: pointer;
    background: transparent;
    border: none;
    text-decoration: none;
    width: 100%;
    text-align: inherit;
}
body[dir="ltr"] .sidebar-btn {
    border-radius: 24px 0 0 24px;
}
.sidebar-btn:hover {
    background: var(--bg-alt);
}
.sidebar-btn.active {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    font-weight: 600;
}
.sidebar-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.sidebar-section {
    padding: 12px 20px 6px;
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
}
/* جلوگیری از رنگ visited */
.sidebar-btn,
.sidebar-btn:visited,
.sidebar-btn:link,
.sidebar-btn:active {
    color: var(--text-2);
    text-decoration: none;
}
.sidebar-btn.active,
.sidebar-btn.active:visited,
.sidebar-btn.active:link {
    color: var(--accent) !important;
    background: var(--accent-soft) !important;
}

/* ========== PAGE HEADER ========== */
.main-content { padding: 12px 0; min-width: 0; }
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 400; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ========== CARD ========== */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 24px; margin-bottom: 16px;
}
.card-title {
    font-size: 16px; font-weight: 500; margin-bottom: 16px;
    color: var(--text); display: flex; align-items: center;
    justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ========== GRID ========== */
.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.drive-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; transition: .15s; cursor: pointer;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
}
.drive-card:hover { box-shadow: var(--shadow-md); border-color: transparent; }
.drive-card-thumb {
    width: 100%; aspect-ratio: 1/1;
    background: var(--bg-alt);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.drive-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: .3s; }
.drive-card:hover .drive-card-thumb img { transform: scale(1.05); }
.drive-card-thumb .icon-wrapper {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
}
.drive-card-thumb .icon-wrapper svg { width: 40px; height: 40px; }
.drive-card-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; }
.drive-card-name {
    font-size: 13px; font-weight: 500; color: var(--text);
    margin-bottom: 4px; word-break: break-all;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4;
}
.drive-card-meta { font-size: 11.5px; color: var(--text-2); margin-top: auto; }
.drive-card-badges {
    position: absolute; top: 8px; right: 8px;
    display: flex; gap: 4px; z-index: 2;
}

/* ========== FORM ========== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 8px;
    font-size: 13.5px; color: var(--text-2); font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit;
    background: var(--card); color: var(--text);
    transition: .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.form-help { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ========== CAPTCHA ========== */
.captcha-box {
    display: flex; gap: 12px; align-items: center;
    background: var(--bg-alt); padding: 12px 16px;
    border-radius: 8px; border: 1px solid var(--border);
    direction: ltr;
}
.captcha-box .question {
    font-size: 20px; font-weight: 600;
    color: var(--accent); direction: ltr;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}
.captcha-box input {
    width: 100px; text-align: center;
    font-size: 18px; direction: ltr; padding: 8px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--card);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 24px;
    background: var(--accent); color: #fff;
    border-radius: 24px; font-size: 14px; font-weight: 500;
    transition: .15s;
}
.btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-alt); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b71c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #0f6628; }
.btn-warn { background: var(--warn); color: #202124; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 16px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ========== ALERT ========== */
.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: #e6f4ea; color: #137333; border: 1px solid #ceead6; }
.alert-danger { background: #fce8e6; color: #c5221f; border: 1px solid #fad2cf; }
.alert-info { background: var(--accent-soft); color: #1967d2; border: 1px solid #d2e3fc; }
.alert-warning { background: #fef7e0; color: #b06000; border: 1px solid #feefc3; }

/* ========== DROP ZONE ========== */
.drop-zone {
    border: 2px dashed var(--border); border-radius: 12px;
    padding: 60px 20px; text-align: center;
    transition: .2s; cursor: pointer; background: var(--card);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent); background: var(--accent-soft);
}
.drop-zone svg { width: 56px; height: 56px; color: var(--text-3); margin-bottom: 16px; }
.drop-zone-title { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.drop-zone-sub { font-size: 13px; color: var(--text-2); }

.drop-overlay {
    position: fixed; inset: 0;
    background: rgba(26,115,232,.95); z-index: 9999;
    display: none; align-items: center; justify-content: center;
    color: #fff; text-align: center; padding: 40px;
}
.drop-overlay.active { display: flex; }
.drop-overlay svg { width: 80px; height: 80px; margin-bottom: 20px; opacity: .9; }
.drop-overlay h2 { font-size: 24px; font-weight: 500; margin-bottom: 8px; }

/* ========== TABLE ========== */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: inherit; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { background: var(--bg-alt); font-weight: 600; color: var(--text-2); font-size: 12.5px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-alt); }

/* ========== BADGE ========== */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 12px; font-size: 11.5px;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 500;
}
.badge-green { background: #e6f4ea; color: #137333; }
.badge-red { background: #fce8e6; color: #c5221f; }
.badge-blue { background: var(--accent-soft); color: #1967d2; }
.badge-warn { background: #fef7e0; color: #b06000; }
.badge-gray { background: #f1f3f4; color: #5f6368; }

/* ========== CHART ========== */
.chart-container { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.chart-title { font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 16px; }
.chart-bars {
    display: flex; align-items: flex-end; gap: 6px;
    height: 160px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border); overflow-x: auto;
}
.chart-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 40px; flex: 1; }
.chart-bar {
    width: 100%; background: linear-gradient(180deg, #4285f4, #1a73e8);
    border-radius: 6px 6px 0 0; min-height: 4px; transition: all .3s;
}
.chart-bar-value { font-size: 11px; color: var(--text-2); font-weight: 600; }
.chart-bar-label { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

/* ========== MODAL ========== */
.modal {
    display: none; position: fixed; inset: 0;
    background: rgba(32,33,36,.6); z-index: 1000;
    align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal-content {
    background: var(--card); border-radius: 16px;
    padding: 24px; max-width: 720px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0,0,0,.2);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 500; }
.modal-close {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); font-size: 22px; transition: .15s;
}
.modal-close:hover { background: var(--bg-alt); }

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; margin-bottom: 20px;
}
.stat-card {
    background: linear-gradient(135deg, var(--accent), #4285f4);
    color: #fff; padding: 18px; border-radius: 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.stat-card .label { font-size: 12.5px; opacity: .9; }
.stat-card .value { font-size: 22px; font-weight: 700; }
.stat-card.alt-1 { background: linear-gradient(135deg, #188038, #34a853); }
.stat-card.alt-2 { background: linear-gradient(135deg, #d93025, #ea4335); }
.stat-card.alt-3 { background: linear-gradient(135deg, #f9ab00, #fbbc04); color: #202124; }

/* ========== WALLET BOX ========== */
.balance-box {
    background: linear-gradient(135deg, #188038, #34a853);
    color: #fff; border-radius: 16px; padding: 24px;
    margin-bottom: 20px;
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 12px;
}
.balance-box .label { font-size: 13px; opacity: .9; }
.balance-box .amount { font-size: 28px; font-weight: 800; margin-top: 4px; }

/* ========== BOTTOM NAV (MOBILE) ========== */
.bottom-nav {
    display: none; position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 8px 8px 14px; z-index: 90;
    box-shadow: 0 -1px 3px rgba(60,64,67,.1);
}
.bottom-nav-inner { display: flex; justify-content: space-around; align-items: center; }
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 11px; color: var(--text-2);
    flex: 1; padding: 6px; border-radius: 8px; transition: .15s;
}
.bottom-nav a.active { color: var(--accent); font-weight: 600; }
.bottom-nav a svg { width: 24px; height: 24px; }

/* ========== MOBILE MENU ========== */
.mobile-menu {
    display: none; position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--card); z-index: 99;
    padding: 12px; overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px; border-radius: 12px;
    color: var(--text); font-size: 15px; font-weight: 500;
    margin-bottom: 4px; transition: .15s;
}
.mobile-menu a:hover, .mobile-menu a.active { background: var(--accent-soft); color: var(--accent); }
.mobile-menu .menu-icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2);
}

/* ========== CLOCK ========== */
.clock-widget {
    font-size: 12px; color: var(--text-2);
    text-align: center; font-weight: 500; line-height: 1.3;
    padding: 4px 8px;
}
.clock-widget .time { color: var(--text); font-size: 14px; font-weight: 600; display: block; }

/* ========== ADMIN MESSAGE ========== */
.admin-message {
    background: #fff3cd; padding: 10px 20px;
    text-align: center; border-bottom: 2px solid #ffc107;
    font-size: 13.5px;
}
.admin-message i { color: #ffc107; margin-inline-end: 8px; }

/* ========== AVATAR ========== */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }

/* ========== UPLOAD BOX ========== */
.upload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 10px 0; }
.upload-box {
    border: 2px dashed var(--border); padding: 16px;
    text-align: center; border-radius: 12px;
    background: var(--bg-alt); cursor: pointer; position: relative;
    transition: .15s;
}
.upload-box:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-box input[type="file"] {
    opacity: 0; position: absolute; inset: 0;
    cursor: pointer; width: 100%; height: 100%;
}
.upload-box.has-file { border-color: var(--success); background: #e6f4ea; }
.upload-box .file-name { font-size: 11.5px; color: var(--text-2); margin-top: 6px; display: block; word-break: break-all; }

/* ========== VERIFIED BADGE ========== */
.verified-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff; padding: 3px 10px;
    border-radius: 12px; font-size: 11px; font-weight: 600;
}
.verified-badge::before { content: '✓'; font-weight: 700; }

/* ========== SPINNER ========== */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 1000px) {
    .layout { grid-template-columns: 1fr; gap: 0; }
    .sidebar { display: none; }
    .mobile-menu.open { display: block; }
    .menu-toggle { display: flex !important; }
    .search-wrap { display: none; }
    .bottom-nav { display: block; }
    body { padding-bottom: 80px; }
    .container { padding: 16px 12px; }
    .topbar-inner { height: 56px; padding: 0 12px; }
    .brand-name { display: none; }
    .drive-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .drive-card-name { font-size: 12px; }
    .drive-card-meta { font-size: 10.5px; }
    .clock-widget { display: none; }
    .upload-grid { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    .page-title { font-size: 18px; }
    .modal-content { padding: 18px; }
    .balance-box { flex-direction: column; text-align: center; }
    .balance-box .amount { font-size: 22px; }
}

@media (min-width: 1001px) {
    .menu-toggle { display: none !important; }
    .mobile-menu { display: none !important; }
    .bottom-nav { display: none !important; }
}

@media (max-width: 500px) {
    .drive-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 12px; }
    .stat-card .value { font-size: 18px; }
    .btn-lg { padding: 12px 20px; font-size: 14px; }
}