/* ===================================
   CSS Variables & Design System
   =================================== */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0e27;
    --bg-secondary: #141937;
    --bg-tertiary: #1e2449;
    --bg-card: #1a1f3a;
    --bg-hover: #252b4d;

    --text-primary: #e8eaf0;
    --text-secondary: #9ca3be;
    --text-tertiary: #6b7494;

    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);

    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --border-color: #2a3158;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Typography */
    --font-arabic: 'Cairo', sans-serif;
    --font-english: 'Inter', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --sidebar-width: 320px;
    --header-height: 64px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ebf4;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f9;

    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ===================================
   CSS Reset & Base Styles
   =================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    height: 100%;
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

button {
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
textarea,
select {
    font-family: inherit;
}

/* ===================================
   Typography
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-lg);
}

p {
    color: var(--text-secondary);
}

/* ===================================
   Layout
   =================================== */
.container {
    display: flex;
    height: 100vh;
    overflow-x: hidden;
    flex-direction: row;
}

[dir="ltr"] .container {
    flex-direction: row;
}

/* ===================================
   Mobile Header
   =================================== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.mobile-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.mobile-actions {
    display: flex;
    gap: var(--space-sm);
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

/* ===================================
   Sidebar
   =================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-base);
}

[dir="ltr"] .sidebar {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.logo-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Search Box */
.search-box {
    position: relative;
    padding: 20px;
    padding-bottom: 16px;
}

.search-icon {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    opacity: 0.7;
}

[dir="ltr"] .search-icon {
    left: 28px;
    right: auto;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    padding-right: 46px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[dir="ltr"] .search-input {
    padding-right: 20px;
    padding-left: 46px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* Categories */
.categories {
    padding: 0 20px;
    padding-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.category-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Tools Section */
.tools-section {
    padding: 0 var(--space-xl);
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tool-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.tool-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(-2px);
}

[dir="ltr"] .tool-item:hover {
    transform: translateX(2px);
}

.tool-item.active {
    background: var(--accent-gradient);
    color: white;
}

.tool-item.active .tool-name,
.tool-item.active .tool-desc {
    color: white;
}

.tool-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-item.active .tool-icon {
    background: rgba(255, 255, 255, 0.2);
}

.tool-info {
    flex: 1;
}

.tool-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tool-desc {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.favorite-btn {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    opacity: 0;
}

.tool-item:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn.active {
    opacity: 1;
    color: #fbbf24;
}

.favorite-btn:hover {
    background: rgba(251, 191, 36, 0.1);
}

/* Privacy Notice */
.privacy-notice {
    padding: var(--space-lg) var(--space-xl);
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-color);
}

.privacy-notice svg {
    flex-shrink: 0;
    color: var(--success);
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    flex: 1;
    padding: var(--space-3xl);
    overflow-y: auto;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--space-3xl) * 2);
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-icon {
    margin-bottom: var(--space-xl);
    filter: drop-shadow(var(--shadow-lg));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-content h2 {
    margin-bottom: var(--space-lg);
}

.welcome-content p {
    margin-bottom: var(--space-2xl);
    font-size: var(--font-size-lg);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.feature-item svg {
    color: var(--accent-primary);
}

.feature-item span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tool Content */
.tool-content {
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-header {
    margin-bottom: var(--space-2xl);
}

.tool-header-top {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.tool-header-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.tool-header-icon svg {
    color: white;
}

.tool-header-content {
    flex: 1;
}

.tool-header-content h2 {
    margin-bottom: var(--space-sm);
}

.tool-header-content p {
    font-size: var(--font-size-lg);
}

/* ===================================
   Components
   =================================== */

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: var(--space-xl);
}

.card-title {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

.card-desc {
    color: var(--text-secondary);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    min-height: 44px;
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-hover);
}

.lang-text {
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.theme-icon {
    transition: all var(--transition-fast);
}

.theme-icon.sun {
    display: block;
}

.theme-icon.moon {
    display: none;
}

[data-theme="light"] .theme-icon.sun {
    display: none;
}

[data-theme="light"] .theme-icon.moon {
    display: block;
}

/* Input */
.form-group {
    margin-bottom: var(--space-xl);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-tertiary);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
}

.dropzone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-icon svg {
    color: white;
}

.dropzone-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.dropzone-hint {
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.privacy-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    color: var(--success);
    font-size: 12px;
    margin-top: auto;
}

/* User Account Section */
.user-section {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin: 20px 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.user-plan {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
}

.btn-login,
.btn-dashboard {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-login:hover,
.btn-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-dashboard {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
    margin-bottom: 10px;
}

.btn-dashboard:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-logout {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.file-item:hover {
    border-color: var(--accent-primary);
}

.file-item.sortable-ghost {
    opacity: 0.5;
}

.file-drag-handle {
    cursor: grab;
    color: var(--text-tertiary);
    padding: var(--space-sm);
}

.file-drag-handle:active {
    cursor: grabbing;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 2px;
    word-break: break-word;
}

.file-meta {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.file-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Progress */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    transition: width var(--transition-base);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    left: var(--space-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 400px;
}

[dir="ltr"] .toast-container {
    right: var(--space-xl);
    left: auto;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn var(--transition-base);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: var(--font-size-sm);
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.toast.success {
    border-color: var(--success);
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.warning {
    border-color: var(--warning);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info {
    border-color: var(--info);
}

.toast.info .toast-icon {
    color: var(--info);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }

    .main-content {
        padding: var(--space-2xl);
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 1000;
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
    }

    [dir="ltr"] .sidebar {
        right: auto;
        left: 0;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header .sidebar-actions {
        display: none;
    }

    .container {
        flex-direction: column;
        padding-top: var(--header-height);
    }

    .main-content {
        padding: var(--space-xl);
    }

    .welcome-screen {
        min-height: calc(100vh - var(--header-height) - var(--space-xl) * 2);
    }

    .tool-header-top {
        flex-direction: column;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: var(--space-lg);
        right: var(--space-lg);
        bottom: var(--space-lg);
        max-width: none;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 100%;
    }

    .main-content {
        padding: var(--space-lg);
    }

    .card {
        padding: var(--space-xl);
    }

    .btn {
        width: 100%;
    }
}

/* ===================================
   Utility Classes
   =================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}