@font-face {
    font-family: 'RTA';
    src: url('assets/rta.ttf') format('truetype');
}

:root {
    --primary: #8e44ad;
    --primary-glow: rgba(142, 68, 173, 0.15);
    --secondary: #9b59b6;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-dim: #64748b;
    --radius-xl: 32px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'RTA', 'Inter', sans-serif;
}

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

/* Light Luxury Background */
.luxury-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    animation: float 25s infinite alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -150px;
    left: -150px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #3498db;
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 120px) scale(1.1); }
}

/* App Shell */
.app-shell {
    display: flex;
    height: 100vh;
}

/* Sidebar (Compact Premium) */
.app-sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border: none; /* Removed border */
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.2rem;
    box-shadow: 15px 0 50px rgba(0, 0, 0, 0.015); /* Reduced shadow intensity */
    z-index: 20;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border: none;
}

.brand-centered {
    text-align: center;
}

.brand-logo-clean {
    height: 70px;
    margin-bottom: 0.3rem;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.sidebar-main {
    flex-grow: 1;
    overflow-y: auto;
    padding-left: 2px;
}

.sidebar-main::-webkit-scrollbar { width: 0; } /* Invisible scroll */

/* Settings Panel (Compact) */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reduced Gap */
}

.settings-group {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: none; /* Removed border */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-item {
    margin-bottom: 1.25rem;
}
.setting-item:last-child { margin-bottom: 0; }

.field-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

/* Radio Selection Cards */
.radio-select-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1rem;
}

.radio-card input, .format-card input {
    display: none;
}

.radio-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.radio-card .card-content i {
    font-size: 1.2rem;
    color: var(--text-dim);
}

.radio-card .card-content span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.radio-card input:checked + .card-content {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.radio-card input:checked + .card-content i,
.radio-card input:checked + .card-content span {
    color: var(--primary);
}

/* Format Tiles */
.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.format-card {
    cursor: pointer;
}

.format-name {
    display: block;
    text-align: center;
    padding: 10px 5px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    transition: var(--transition);
}

.format-card input:checked + .format-name {
    border-color: var(--primary);
    background: var(--primary-glow);
    color: var(--primary);
}

.radio-card:hover .card-content, .format-card:hover .format-name {
    border-color: var(--primary);
}
/* Input Rows (Professional Integration) */
.field-row {
    position: relative;
    display: flex;
    align-items: center;
}

.premium-input {
    width: 100%;
    padding: 10px 14px;
    padding-left: 35px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}

.premium-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.unit {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    pointer-events: none;
    background: white;
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Sidebar Sections */
.setting-group {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.8rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.group-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-title i {
    color: var(--primary);
}

/* Custom Range */
.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 10px;
    outline: none;
}
.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(142, 68, 173, 0.3);
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-top: 1rem;
    font-weight: 500;
}
.checkbox-container input { display: none; }
.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    position: relative;
    transition: var(--transition);
}
.checkbox-container input:checked + .checkmark { background: var(--primary); border-color: var(--primary); }
.checkbox-container input:checked + .checkmark::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: white;
}

/* Sidebar Footer Actions */
.sidebar-footer {
    padding: 1rem 0 0.5rem;
    border: none;
    background: transparent;
}

.action-btn {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(142, 68, 173, 0.25);
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(142, 68, 173, 0.35);
}

.action-btn.outline {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}

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

.text-danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-group { margin-bottom: 0.8rem; }
.nav-group:last-child { margin-bottom: 0; }

/* Main Content */
.app-content {
    flex-grow: 1;
    min-width: 0;
    padding: 3rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-view { display: none; height: 100%; }
.content-view.active { display: block; animation: fadeIn 0.5s ease-out; }

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

/* Ready Stage */
.ready-header {
    margin-bottom: 2.8rem;
    text-align: right;
}

.ready-header h2 { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.4rem; }
.ready-header p { color: var(--text-dim); font-size: 1.05rem; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.8rem;
    overflow-y: auto;
    padding-bottom: 3rem;
    scrollbar-width: none;
}

.ready-thumb {
    aspect-ratio: 1/1;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.ready-thumb:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); border-color: var(--primary); }
.ready-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ready-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-main);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.result-size-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.ready-remove {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #ef4444;
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.result-download-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 38px;
    height: 38px;
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--primary-glow);
    transition: var(--transition);
    z-index: 10;
}

.result-download-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(142, 68, 173, 0.4);
}

.add-more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: var(--text-dim);
}
.add-more-card:hover { border-color: var(--primary); color: var(--primary); background: #f8fafc; }
.add-more-card i { font-size: 2.4rem; }

/* Processing */
.processing-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.orb-loader {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.8rem;
}

.orb-spinner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 5px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.orb-loader i { font-size: 2.8rem; color: var(--primary); }

@keyframes spin { 100% { transform: rotate(360deg); } }

.processing-progress {
    width: 450px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}



/* Utilities */
.hidden { display: none !important; }
