/* ====================================================================
   VenuxPass - Modern Dark Cyber Theme
   Direction: RTL with complete responsive support
   ==================================================================== */

:root {
    --bg-darker: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #172033;
    --bg-input: #0f172a;
    --border-color: #1f293d;
    --border-focus: #6366f1;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Utilities */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-secondary {
    background: #1e293b;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: #334155;
}
.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
    color: #fff;
}
.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}
.btn-icon:hover {
    color: var(--text-main);
    background: #1e293b;
    border-color: var(--border-color);
}

/* Inputs */
.form-group {
    margin-bottom: 16px;
    text-align: right;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}
.input-control {
    width: 100%;
    padding: 11px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.input-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group .input-control {
    padding-left: 42px;
}
.input-group .toggle-pass {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}
.input-group .toggle-pass:hover {
    color: var(--text-main);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-item:hover {
    background: #1e293b;
    color: var(--text-main);
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), transparent);
    color: #818cf8;
    border-right: 3px solid var(--primary);
    font-weight: 700;
}
.nav-item .icon {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
}
.nav-item .badge {
    margin-right: auto;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #1e293b;
    color: var(--text-dim);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #0f172a;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.user-info {
    flex: 1;
    overflow: hidden;
}
.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 0.75rem;
    color: var(--accent-cyan);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.top-bar {
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}
.search-wrapper {
    position: relative;
    width: 380px;
    max-width: 100%;
}
.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}
.search-input {
    width: 100%;
    padding: 10px 42px 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}
.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.content-body {
    padding: 28px;
    flex: 1;
}

/* Vault Item Grid */
.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.vault-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.vault-card:hover {
    background: var(--bg-card-hover);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.card-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent-cyan);
}
.card-title-group {
    flex: 1;
    margin-right: 12px;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}
.card-category {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.star-btn {
    background: none;
    border: none;
    color: #475569;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.star-btn.active {
    color: var(--accent-amber);
}

.card-field {
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.9rem;
}
.field-val {
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
}
.copy-pill {
    background: #1e293b;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.copy-pill:hover {
    background: var(--primary);
    color: #fff;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 560px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 18px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* Strength Meter */
.strength-bar-container {
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}
.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
}
.strength-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--text-dim);
}

/* Admin Dashboard Elements */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-val {
    font-size: 1.7rem;
    font-weight: 800;
}
.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Data Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.9rem;
}
.data-table th {
    background: #0f172a;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.status-suspended {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}
.toast-success { border-right: 4px solid var(--accent-emerald); }
.toast-error { border-right: 4px solid var(--accent-rose); }
.toast-info { border-right: 4px solid var(--accent-cyan); }

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 860px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    .top-bar {
        flex-direction: column;
        gap: 12px;
    }
    .search-wrapper {
        width: 100%;
    }
}
