:root {
    /* Color Palette */
    --primary: #7c5ced;
    --primary-light: #9d85f2;
    --primary-dark: #5e3ecb;
    --secondary: #d4af37;
    --accent: #ff4d94;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Light Theme (Only) */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-glass: rgba(124, 92, 237, 0.1);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.05);
    --shadow-hard: 0 20px 60px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Shared */
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --trans-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl; /* RTL Support */
}

/* Background Effects */
.luxury-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: orbit 30s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 { width: 800px; height: 800px; background: var(--primary); top: -200px; right: -200px; }
.orb-2 { width: 700px; height: 700px; background: var(--secondary); bottom: -150px; left: -150px; animation-delay: -10s; }
.orb-3 { width: 500px; height: 500px; background: var(--accent); top: 30%; left: 10%; animation-delay: -5s; opacity: 0.1; }

@keyframes orbit {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(150px, 150px) scale(1.1); }
}

/* App Shell */
.app-shell {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: grid;
    grid-template-columns: 320px 1fr; /* First column (sidebar) will be on the right in RTL */
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-hard);
    margin: 20px;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(124, 92, 237, 0.03);
    border-left: 1px solid var(--border-glass); /* In RTL, this border is between sidebar (right) and content (left) */
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.brand-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.logo-container {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1.5px solid var(--border-glass);
}

.brand-section h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: var(--trans-fast);
    cursor: default;
    border: 1px solid transparent;
}

.nav-item.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-soft);
    border-color: var(--border-glass);
}

.history-section {
    margin-top: auto;
}

.history-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: var(--radius-lg);
}

.history-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Main Content Area */
.main-content {
    padding: 50px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.content-header {
    margin-bottom: 40px;
}

.content-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-main);
}

.content-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    line-height: 1.6;
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    min-height: 350px;
    border: 3px dashed #cbd5e1;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    background: rgba(255, 255, 255, 0.4);
    transition: var(--trans-slow);
    cursor: pointer;
    padding: 40px;
    text-align: center;
}

.drop-zone:hover, .drop-zone.active {
    border-color: var(--primary);
    background: rgba(124, 92, 237, 0.05);
}

.drop-icon {
    width: 100px;
    height: 100px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.btn-browse {
    padding: 14px 35px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(124, 92, 237, 0.3);
}

/* File List */
.file-list {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.file-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.3s ease-out;
}

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

.file-icon {
    width: 45px;
    height: 45px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 700; font-size: 0.95rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 0.8rem; color: var(--text-muted); }

.btn-remove {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.btn-remove:hover { transform: rotate(90deg); }

/* Footer Actions */
.footer-actions {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-main {
    padding: 18px 45px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-convert {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 20px 40px rgba(124, 92, 237, 0.3);
}

.btn-convert:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; opacity: 0.7; }
.btn-convert:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 25px 50px rgba(124, 92, 237, 0.4); }

.btn-clear { background: white; color: var(--text-muted); border: 1px solid #e2e8f0; }
.btn-clear:hover { color: var(--error); border-color: var(--error); }

/* Spinner */
.spinner { animation: rotate 1s linear infinite; display: inline-block; }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Mobile Adaptations */
@media (max-width: 1000px) {
    .app-shell { grid-template-columns: 1fr; height: auto; border-radius: 0; margin: 0; }
    .sidebar { border-left: none; border-bottom: 1px solid var(--border-glass); }
}
