/* ===== Dashboard User CSS - Fal Studio ===== */
/* ملف منفصل لداشبورد التشفير */

:root {
    --bg: #080a0d;
    --bg-card: rgba(20, 23, 28, 0.95);
    --bg-input: rgba(15, 17, 21, 0.8);
    --bg-sidebar: rgba(18, 21, 26, 0.98);
    --primary: #d4a855;
    --primary-dark: #b8944a;
    --danger: #ff5050;
    --text: #ffffff;
    --text-muted: #888888;
    --border: rgba(255, 255, 255, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    padding: 1.25rem;
    width: 220px;
    min-width: 220px;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header img {
    width: 32px;
    height: 32px;
}

.sidebar-header span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.85rem;
    text-decoration: none;
}

.sidebar-nav a:hover {
    background: var(--bg-input);
    color: var(--text);
}

.sidebar-nav a.active {
    background: var(--bg-input);
    color: var(--primary);
}

.sidebar-nav a i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

/* ===== MAIN CONTENT ===== */
.dashboard-content {
    flex: 1;
    margin-right: 220px;
    padding: 1.25rem 1.5rem;
    min-height: 100vh;
    background: var(--bg);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    font-size: 1.3rem;
    color: var(--text);
}

/* ===== TABS ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    background: var(--bg-input);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 1.4rem;
    color: var(--primary);
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== SETTINGS CARD ===== */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.settings-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.1rem;
    color: var(--primary);
}

/* ===== DATA TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.875rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.data-table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table td {
    color: var(--text);
}

.data-table tr:hover {
    background: var(--bg-input);
}

.data-table code {
    background: var(--bg);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(212, 168, 85, 0.25);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-input);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #0a0a0c;
}

.btn-icon.danger:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: #fff;
}

/* ===== INPUT GROUP ===== */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(212, 168, 85, 0.15);
}

.input-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(212, 168, 85, 0.15);
    color: var(--primary);
}

.status-badge.inactive {
    background: rgba(255, 80, 80, 0.15);
    color: var(--danger);
}

/* ===== MODAL - داشبورد المستخدم ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

#code-modal .modal-content {
    max-width: 650px;
}

#howitworks-modal .modal-content {
    max-width: 700px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.05);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-input);
    border-radius: 0 0 12px 12px;
}

/* ===== CODE MODAL ===== */
.code-settings {
    background: var(--bg-input);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.code-setting-item {
    margin-bottom: 0.75rem;
}

.code-setting-item:last-child {
    margin-bottom: 0;
}

.code-setting-item label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.code-setting-item input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
}

.code-setting-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.code-output {
    background: #0d0f12;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.code-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

.code-output-header span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

#generated-code {
    padding: 1rem;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--primary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* ===== HOW IT WORKS ===== */
.how-it-works-image {
    margin-bottom: 1rem;
    text-align: center;
}

.how-it-works-image img {
    max-width: 100%;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.how-it-works-image img:hover {
    transform: scale(1.02);
}

.how-it-works-text {
    background: var(--bg-input);
    border-radius: 10px;
    padding: 1rem;
}

.how-it-works-text p {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.how-it-works-text p:last-child {
    margin-bottom: 0;
}

.how-it-works-text code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.8rem;
}

.how-it-works-text a {
    color: var(--primary);
}

.success-text {
    color: var(--primary) !important;
    font-weight: 600;
}

/* ===== AVATAR ===== */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-preview i {
    font-size: 2rem;
    color: var(--text-muted);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.avatar-actions .text-muted {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    z-index: 10000;
    display: none;
}

.toast.show {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.3s ease;
}

.toast.success {
    border-color: var(--primary);
    background: rgba(212, 168, 85, 0.95);
    color: #000;
}

.toast.error {
    border-color: var(--danger);
    background: rgba(255, 80, 80, 0.95);
    color: #fff;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== CODE STYLING ===== */
code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::selection {
    background: rgba(212, 168, 85, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        height: auto;
        right: auto;
        border-left: none;
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
    }
    
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .sidebar-nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .dashboard-content {
        margin-right: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .code-setting-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }
}