:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-color: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --danger: #ef4444;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    --radius: 20px;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 120px; /* فضای خالی برای منوی پایین */
}

/* RTL Support */
body.rtl { direction: rtl; text-align: right; }
body.rtl .file-actions { left: 15px; right: auto; }

/* Utilities */
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
.btn { border: none; padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.btn-danger { background: var(--danger); color: white; }
.btn-glass { background: white; color: var(--text-main); border: 1px solid #ddd; }
.btn:hover { transform: translateY(-2px); opacity: 0.95; }

/* Icons (SVG) */
.icon { width: 20px; height: 20px; fill: currentColor; }
.icon-lg { width: 40px; height: 40px; }
.icon-xl { width: 60px; height: 60px; }

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

/* Login Page */
.login-wrapper {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
    padding: 20px;
}
.login-box { width: 100%; max-width: 400px; text-align: center; }
.login-input {
    width: 100%; padding: 14px; margin: 10px 0;
    border-radius: 12px; border: 1px solid #ddd;
    background: rgba(255,255,255,0.9); outline: none; font-size: 1rem;
}

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding: 15px;
    background: var(--glass-bg); backdrop-filter: blur(10px);
    border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.logo { font-size: 1.1rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }

/* Breadcrumbs */
.breadcrumbs {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 0;
    white-space: nowrap; margin-bottom: 20px; align-items: center;
}
.crumb { background: white; padding: 6px 14px; border-radius: 20px; text-decoration: none; color: var(--text-muted); font-size: 0.85rem; display: flex; align-items: center; }
.crumb.active { color: var(--primary); font-weight: bold; background: #e0e7ff; }

/* File Grid */
.file-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}
.file-item {
    position: relative;
    background: white; padding: 15px;
    border-radius: 18px; text-align: center;
    transition: 0.2s; cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid transparent;
    display: flex; flex-direction: column; align-items: center;
}
.file-item:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); border-color: var(--primary); }
.file-icon-box { margin-bottom: 10px; color: var(--primary); }
.folder-color { color: #f59e0b; }
.file-name { font-size: 0.85rem; word-break: break-all; color: var(--text-main); line-height: 1.4; }

/* File Actions */
.item-actions {
    margin-top: 10px; display: flex; justify-content: center; gap: 10px; 
    border-top: 1px solid #eee; padding-top: 8px; width: 100%;
}
.action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 5px; }
.action-btn:hover { background: #f3f4f6; color: var(--primary); }
.action-btn.delete:hover { color: var(--danger); }

/* Upload Area (Toggle) */
.upload-area { margin-bottom: 20px; display: none; }
.upload-area.show { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from {opacity:0; transform: translateY(-10px);} to {opacity:1; transform: translateY(0);} }

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.95); backdrop-filter: blur(10px);
    padding: 10px 20px; border-radius: 50px;
    display: flex; gap: 20px; align-items: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    z-index: 1000; width: max-content;
}
.nav-item { color: rgba(255,255,255,0.6); background: none; border: none; cursor: pointer; padding: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s;}
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,0.1); }
.nav-upload-btn {
    background: var(--primary); color: white;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-top: -35px; border: 5px solid var(--bg-color);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4); cursor: pointer;
}
.nav-upload-btn:hover { transform: scale(1.05); }

/* Responsive adjustments */
@media (max-width: 480px) {
    .container { padding: 15px; }
    .file-grid { grid-template-columns: repeat(2, 1fr); }
}
