/* ==========================================================================
   Rejust Backup Generator - CSS Design System & Theme Styles
   Primary Color: #1B5E20 | Secondary Color: #70161e
   Fonts: PeydaFaNum (Titles) & IRANSansXFaNum (Body)
   ========================================================================== */

/* Font Face Definitions */
@font-face {
    font-family: 'PeydaFaNum';
    src: url('../fonts/PeydaWebFaNum-Bold.woff2') format('woff2'),
         url('../fonts/PeydaWebFaNum-Bold.woff') format('woff'),
         url('../fonts/PeydaFaNum-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'PeydaFaNum';
    src: url('../fonts/PeydaWebFaNum-Regular.woff2') format('woff2'),
         url('../fonts/PeydaWebFaNum-Regular.woff') format('woff'),
         url('../fonts/PeydaFaNum-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSansXFaNum';
    src: url('../fonts/IRANSansXFaNum-Bold.woff2') format('woff2'),
         url('../fonts/IRANSansXFaNum-Bold.woff') format('woff'),
         url('../fonts/IRANSansXFaNum-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'IRANSansXFaNum';
    src: url('../fonts/IRANSansXFaNum-Regular.woff2') format('woff2'),
         url('../fonts/IRANSansXFaNum-Regular.woff') format('woff'),
         url('../fonts/IRANSansXFaNum-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* CSS Variables */
:root {
    --primary: #1B5E20;
    --primary-hover: #144718;
    --primary-light: rgba(27, 94, 32, 0.12);
    --secondary: #70161e;
    --secondary-hover: #541016;
    --secondary-light: rgba(112, 22, 30, 0.12);
    --accent: #2e7d32;
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-light: rgba(27, 94, 32, 0.25);
    --secondary-light: rgba(112, 22, 30, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'IRANSansXFaNum', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    direction: rtl;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    transition: var(--transition);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'PeydaFaNum', 'IRANSansXFaNum', sans-serif;
    font-weight: bold;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Sidebar Navigation */
.app-sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 100;
    transition: var(--transition);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.brand-title {
    font-size: 1.25rem;
    color: var(--primary);
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-item a:hover, .nav-item.active a {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(-4px);
}

.nav-item a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Main Content Area */
.app-main {
    margin-right: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* Header Bar */
.app-header {
    height: 72px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Glassmorphic Cards & Panels */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    transition: var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 18px rgba(27, 94, 32, 0.45);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(112, 22, 30, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 18px rgba(112, 22, 30, 0.45);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Switch Toggle */
.switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Wizard Steps Indicator */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: bold;
    transition: var(--transition);
}

.step-item.active .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 6px var(--primary-light);
}

.step-item.completed .step-icon {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #ffffff;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-item.active .step-label {
    color: var(--primary);
}

/* Wizard Step Content Containers */
.wizard-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.wizard-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Permission Checks Grid */
.permission-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
	margin: 20px 0px;
}

.perm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}

.perm-item.success {
    border-right: 4px solid #16a34a;
}

.perm-item.danger {
    border-right: 4px solid #dc2626;
}

.perm-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.perm-badge.success {
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}

.perm-badge.danger {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

/* Code Display Box */
.code-box {
    background: #0f172a;
    color: #38bdf8;
    padding: 16px;
    border-radius: var(--radius-md);
    direction: ltr;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    position: relative;
    word-break: break-all;
    user-select: all;
}

.code-box .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
}

/* Table Design */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table th, .table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.table tr:hover {
    background: var(--primary-light);
}

/* Login Page Layout */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-body);
    transition: var(--transition);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 36px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
    transition: var(--transition);
}

.login-logo {
    display: block;
    max-height: 64px;
    margin: 0 auto 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    border-right: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s forwards;
    min-width: 280px;
}

.toast.error {
    border-right-color: #dc2626;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        right: -280px;
        top: 0;
        bottom: 0;
        box-shadow: var(--shadow-lg);
    }
    
    .app-sidebar.show {
        right: 0;
    }

    .app-main {
        margin-right: 0;
    }

    .header-mobile-toggle {
        display: block !important;
    }

    .wizard-steps {
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .app-header {
        padding: 0 16px;
    }
}

/* Modal & Progress Bar Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
    position: relative;
}

.progress-bar-container {
    width: 100%;
    height: 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #2e7d32);
    border-radius: 20px;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 10px rgba(27, 94, 32, 0.4);
}

.mb-3.font-heading {
	margin: 10px 0px;
}

#settingsTestTelegramBtn {
	margin: 10px 0px;
}

#step1-next-btn {
	margin: 10px 0px;
}

#wizard_retention_count {
	margin: 10px 0px;
}

#testTelegramBtn {
	margin: 10px 0px;
}

.row.g-3 {
	margin: 10px 0px;
}

#finishWizardBtn {
	margin: 10px 0px;
}

.col-md-6 {
	margin: 10px 0px;
}

.perm-item {
	margin: 10px 0px;
}
.alert.alert-success.p-3.mb-3 {
	margin: 10px 0px;
	padding: 10px;
}

#closeProgressModalBtn {
	margin: 10px 0px;
}

#closeProgressModalBtn {
	margin: 10px 0px;
}

.btn.btn-primary.btn-lg.w-100.mb-2 {
	margin: 10px 0px;
}

#wizard_exclude_folders {
	margin: 10px 0px;
}

#wizard_exclude_exts {
	margin: 10px 0px;
}

#wizard_backup_prefix {
	margin: 10px 0px;
}

.p-3.mb-4.rounded {
	padding: 10px;
}

.mt-3 {
	margin: 10px 0px;
}

.btn.btn-primary.btn-lg {
	margin: 10px 0px;
}

/* Modern Remote Storage Tabs Styling */
.remote-tabs-nav {
    display: flex;
    gap: 12px;
    margin: 10px 0px;
    border-bottom: 2px solid var(--border-color);
    padding: 10px;
    overflow-x: auto;
}

.remote-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-family: 'PeydaFaNum', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.remote-tab-btn i {
    font-size: 1.1rem;
    transition: transform 0.25s ease;
}

.remote-tab-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.remote-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(27, 94, 32, 0.25);
}

.remote-tab-btn.active i {
    transform: scale(1.15);
}

.remote-tab-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: bold;
}

.remote-tab-badge.badge-active {
    background: #2e7d32;
    color: #ffffff;
}

.remote-tab-badge.badge-disabled {
    background: rgba(120, 120, 120, 0.2);
    color: var(--text-muted);
}

.remote-tab-pane {
    display: none;
    animation: fadeInTab 0.3s ease-in-out;
}

.remote-tab-pane.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.p-4.rounded.mb-4 {
	margin: 10px 0px;
	padding: 10px;
}

.form-control {
	margin: 10px 0px;
}

#testWizardSiteRootBtn {
	margin: 10px 0px;
}

.alert.alert-info.py-2.px-3.mb-3.small {
	margin: 10px 0px;
}

.mt-4.p-3.border.rounded {
    margin: 10px 0px;
    padding: 10px;
}