/* 
  PDF Tools Design System 
  Colors based on Logo Assets:
  - Deep Purple: #786eb1
  - Soft Purple: #9e92c6
  - Accent Gold: #e9ce66
*/

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

:root {
    --primary: #786eb1;
    --primary-light: #9e92c6;
    --primary-dark: #5a5194;
    --accent: #e9ce66;
    --text-main: #1a1a1b;
    --text-muted: #5f6368;
    --bg-gradient: linear-gradient(135deg, #f3f4ff 0%, #e8eaff 100%);
    --card-bg: #ffffff;
    --glass-border: rgba(120, 110, 177, 0.08);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 20px 50px rgba(120, 110, 177, 0.12);
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    /* Hide scrollbars */
    -webkit-scrollbar: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar, ::-webkit-scrollbar {
    display: none;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Brand Styling */
.top-brand {
    text-align: center;
    padding: 60px 20px 20px 20px;
    background: transparent;
    z-index: 100;
}

.top-brand img {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 20px rgba(120, 110, 177, 0.15));
    transition: transform 0.4s ease;
}

.top-brand:hover img {
    transform: translateY(-5px) scale(1.05);
}

.brand-text {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    padding: 40px 60px 80px 60px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInContent 0.8s ease-out;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Tool Switcher (Segmented Radio) */
.tool-switcher {
    display: flex;
    background: white;
    padding: 6px;
    border-radius: 20px;
    margin: 0 auto 50px auto;
    width: fit-content;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    gap: 5px;
}

.switch-btn {
    padding: 12px 30px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.4s ease;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(120, 110, 177, 0.2);
}

.switch-btn i { font-size: 1.1rem; }

.switch-btn:not(.active):hover {
    background: rgba(120, 110, 177, 0.05);
    color: var(--primary);
}

/* Workspace Panels */
.workspace-section {
    background: white;
    border-radius: 45px;
    padding: 60px;
    display: none;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 30px 80px rgba(0,0,0,0.06);
    border: 1px solid var(--glass-border);
    margin-top: 20px;
}

.active-section {
    display: block !important;
}

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

/* Enhanced Drop Zone */
.drop-zone {
    border: 2px dashed rgba(120, 110, 177, 0.12);
    border-radius: 40px;
    padding: 100px 40px;
    text-align: center;
    background: rgba(120, 110, 177, 0.015);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(120, 110, 177, 0.05);
    transform: scale(0.995);
}

.drop-zone i.main-icon {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 5px;
    opacity: 0.8;
    transition: all 0.4s ease;
}

.drop-zone:hover i.main-icon {
    transform: translateY(-10px);
    opacity: 1;
}

.drop-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.subtext-hint {
    color: var(--text-muted);
    font-size: 0.95rem;
    opacity: 0.7;
    margin-bottom: 20px;
}

/* Fancy Upload Button */
.fancy-upload-btn {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(120, 110, 177, 0.06);
}

.fancy-upload-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(120, 110, 177, 0.2);
}

.fancy-upload-btn i {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.fancy-upload-btn:hover i {
    background: white;
    color: var(--primary);
}

/* Buttons & Controls */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(120, 110, 177, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(120, 110, 177, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2.5px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

/* File Previews */
#pdf-merge-list, #split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 35px;
    margin-top: 50px;
}

.pdf-item {
    background: white;
    border-radius: 30px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.02);
}

.pdf-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    border-color: var(--primary-light);
}

.pdf-preview {
    width: 100%;
    aspect-ratio: 1 / 1.35;
    background: #f8f9ff;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}

.pdf-preview img { width: 100%; height: 100%; object-fit: cover; }

.remove-btn-large {
    background: #fff5f5;
    color: #ff5c5c;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.remove-btn-large:hover {
    background: #ff5c5c;
    color: white;
    transform: rotate(10deg);
}

/* Loading States */
.fa-spin {
    animation: fa-spin 1.5s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(350deg); }
}

@media (max-width: 768px) {
    .main-content { padding: 40px 20px; }
    .tools-selection { grid-template-columns: 1fr; }
    .workspace-section { padding: 40px 20px; }
}

.hidden-section { display: none !important; }
