/* Styles for Love PDF Clone - Modern Premium Web Application */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #019ba5;
    --primary-hover: #0547A8;
    --primary-light: #01ddec;
    --primary-glow: #7cf6ff;
    --accent: #0089f7;
    --accent-hover: #0078db;
    --accent-light: rgba(0, 137, 247, 0.1);
    
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-workspace: #ffffff;
    
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --overlay: rgba(16, 33, 59, 0.6);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px 0 var(--primary-glow);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-base: #0b0f19;
    --bg-surface: #151c2c;
    --bg-surface-hover: #1e293b;
    --bg-workspace: #111827;
    
    --border: #1e293b;
    --border-hover: #334155;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --primary-light: rgba(16, 33, 59, 0.12);
    --primary-glow: rgba(16, 33, 59, 0.25);
    --primary-soft: rgba(16, 33, 59, 0.3);
    --primary-overlay: rgba(16, 33, 59, 0.85);
    --accent-light: rgba(0, 137, 247, 0.14);
    --accent-soft: rgba(0, 137, 247, 0.24);
    --accent-strong: rgba(0, 137, 247, 0.36);
    --overlay: rgba(16, 33, 59, 0.65);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Header Styles */
header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 19rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon, .logo-icon-svg {
    width: 3.5rem;
    height: auto;
    color: var(--primary);
    filter: drop-shadow(0 1px 1px var(--primary-glow));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.logo-text span {
    color: var(--accent);
}

.logo-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    border-left: 1px solid var(--border);
    padding-left: 0.75rem;
    margin-left: 0.5rem;
    display: none; /* Hide on mobile */
}

@media (min-width: 768px) {
    .logo-tagline {
        display: inline-block;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toggle Switch */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
    background-color: var(--primary-light);
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

/* Dashboard Container */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 9rem;
}

/* Upload Container */
.upload-hero {
    background-color: var(--bg-surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem;
    text-align: center;
    margin-bottom: 4rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.upload-hero:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 22px rgba(76, 121, 225, 0.08);
    transform: translateY(-1px);
}

/* .upload-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: px;
    background-color: var(--primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
} */

.upload-hero:hover::before {
    opacity: 1;
}

.upload-icon-wrapper {
    display: none !important;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.upload-subtitle {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.upload-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 10px rgba(16, 33, 59, 0.2);
}

.upload-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 33, 59, 0.25);
}

.upload-btn:active {
    transform: translateY(1px);
}

.upload-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Tool Sections */
.tool-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.5rem;
    color: #04419B;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 2rem;
    height: 3px;
    background-color: #04419B;
    border-radius: 2px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* Tool Cards */
.tool-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
    background-color: var(--bg-surface-hover);
}

.tool-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: white;
    background-color: var(--primary);
    transition: all var(--transition-fast);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.1);
}

.tool-card-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.tool-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.tool-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Workspace Panels */
.workspace-container {
    display: none; /* Changed to flex in JS */
    position: fixed;
    top: 4.5rem; /* Header height */
    left: 0;
    width: 100%;
    height: calc(100vh - 4.5rem);
    background-color: var(--bg-workspace);
    z-index: 90;
    overflow: hidden; /* Changed from auto to hidden for full-height sidebars */
    padding: 0; /* Changed from padding to 0 for flush sidebars */
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-slow);
}

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

.workspace-header {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-surface);
    flex-shrink: 0;
}

.workspace-title-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.workspace-back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.workspace-back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
    transform: translateX(-2px);
}

.workspace-back-btn svg {
    width: 1rem;
    height: 1rem;
}

.workspace-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.workspace-body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    flex: 1;
    min-height: 0;
    height: 100%;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .workspace-body.has-sidebar {
        grid-template-columns: 1fr 320px;
    }
}

/* Left Navigation Sidebar Styling */
.workspace-nav-sidebar {
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    width: 260px;
    padding: 1.5rem 1rem;
    transition: transform var(--transition-normal);
}

/* Custom Scrollbar for navigation sidebar */
.workspace-nav-sidebar::-webkit-scrollbar {
    width: 6px;
}
.workspace-nav-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.workspace-nav-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}
.workspace-nav-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-hover);
}

/* Sidebar Brand / Header inside sidebar */
.nav-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.nav-sidebar-logo-box {
    background-color: var(--accent);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px var(--accent-soft);
}

.nav-sidebar-logo-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.nav-sidebar-brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* Navigation items structure */
.nav-sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.nav-group-title-text {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.nav-item.child-nav {
    padding-left: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--primary);
}

.nav-item.child-nav:hover {
    color: var(--text-main);
}

/* Active Nav Item styling - matching user's image (Split PDF highlight) */
.nav-item.active {
    background-color: var(--accent-light);
    color: var(--accent);
}

[data-theme="dark"] .nav-item.active {
    background-color: var(--accent-soft);
    color: var(--accent);
}

/* Keep original colors for multi-color icons in items */
.nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-icon-svg {
    transition: all var(--transition-fast);
}

/* Hover/active adjustments for SVGs */
.nav-item.active .icon-fg-color {
    fill: var(--accent);
}
[data-theme="dark"] .nav-item.active .icon-fg-color {
    fill: var(--accent);
}

.nav-item.active .icon-bg-gray {
    fill: var(--accent-soft);
}

.nav-item.active .icon-bg-gray-stroke {
    stroke: var(--accent-strong);
}

.nav-separator {
    border: 0;
    height: 1px;
    background-color: var(--border);
    margin: 0.25rem 0;
}

/* Mobile Toggle button styling */
.workspace-nav-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.workspace-nav-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.workspace-nav-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Responsive media queries for layout */
@media (min-width: 1024px) {
    .workspace-body.has-sidebar {
        grid-template-columns: 280px 1fr 340px;
        align-items: stretch; /* Stretch children to full-height of row */
        height: 100%;
        overflow: hidden;
    }
    
    .workspace-nav-sidebar {
        height: 100%;
        max-height: 100%;
        border-top: none;
        border-bottom: none;
        border-left: none;
        border-right: 1px solid var(--border);
        border-radius: 0; /* Flat flush look */
    }
    
    .workspace-main {
        height: 100%;
        max-height: 100%;
        overflow-y: auto; /* Center content scrolls independently */
        padding: 2rem 2.5rem;
    }
    
    .workspace-sidebar {
        height: 100%;
        max-height: 100%;
        overflow-y: auto; /* Right settings sidebar scrolls independently */
        border-top: none;
        border-bottom: none;
        border-right: none;
        border-left: 1px solid var(--border);
        border-radius: 0; /* Flat flush look */
        box-shadow: none;
        background-color: var(--bg-surface);
    }
}

@media (max-width: 1023px) {
    .workspace-nav-toggle {
        display: flex; /* Show toggle on mobile/tablet */
    }
    
    .workspace-nav-sidebar {
        position: fixed;
        top: 4.5rem; /* under header */
        left: 0;
        height: calc(100vh - 4.5rem);
        z-index: 100;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
    }
    
    .workspace-nav-sidebar.open {
        transform: translateX(0);
    }
    
    /* Layout with drawer nav is 1fr 320px or 1fr depending on screen size */
    .workspace-body.has-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Workspace Drag and Drop Zone */
.workspace-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.workspace-dropzone:hover {
    border-color: var(--primary);
    background-color: var(--bg-surface-hover);
}

/* Sidebar configuration panels */
.workspace-sidebar {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.sidebar-select, .sidebar-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.sidebar-select:focus, .sidebar-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.sidebar-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 10px rgba(16, 33, 59, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 14px rgba(16, 33, 59, 0.25);
}

.sidebar-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Page Previews / Thumbnails Grid */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
    width: 100%;
    padding: 0.5rem;
}

.thumbnail-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    user-select: none;
}

.thumbnail-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.thumbnail-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary);
}

.thumbnail-card-preview {
    width: 100%;
    height: 140px;
    background-color: var(--bg-base);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
}

.thumbnail-card-preview canvas,
.thumbnail-card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnail-card-info {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumbnail-card-actions {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.thumbnail-card:hover .thumbnail-card-actions {
    opacity: 1;
}

.thumbnail-action-btn {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.thumbnail-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

.thumbnail-action-btn.delete:hover {
    border-color: var(--accent-hover);
    color: var(--accent-hover);
    background-color: var(--accent-light);
}

.thumbnail-action-btn svg {
    width: 0.85rem;
    height: 0.85rem;
}

.thumbnail-page-number {
    position: absolute;
    bottom: 2.25rem;
    left: 0.5rem;
    background-color: var(--primary-overlay);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* File List (Simple list style) */
.file-list-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-row {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.file-row:hover {
    border-color: var(--primary);
}

.file-row-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-row-icon {
    color: var(--primary);
}

.file-row-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.file-row-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.file-row-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress / Overlay screen */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 150;
    align-items: center;
    justify-content: center;
    color: white;
}

.loading-content {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.loading-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Text area input for TXT to PDF */
.text-input-area {
    width: 100%;
    min-height: 350px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.text-input-area:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* FAQ Footer Section */
footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 4rem 1.5rem 2rem 1.5rem;
    margin-top: 5rem;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.faq-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.faq-item p, .faq-item ul {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-item ul {
    padding-left: 1.25rem;
}

.faq-item li {
    margin-bottom: 0.25rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    background-color: var(--primary-light);
}

.social-link svg {
    width: 1rem;
    height: 1rem;
}

/* Modal style dialogs */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 90%;
    border: 1px solid var(--border);
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
}

.modal-btn-primary:hover {
    background-color: var(--primary-hover);
}

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

.modal-btn-secondary:hover {
    background-color: var(--bg-surface-hover);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 300;
}

.toast {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 250px;
    max-width: 350px;
}

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

.toast.success {
    border-left-color: var(--accent);
}

.toast.error {
    border-left-color: var(--primary);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Advertisement Placeholders styling */
.ad-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-align: center;
}

/* Sidebar Ad Box */
.sidebar-ad-container {
    margin-top: auto; /* Push to bottom of sidebar */
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.sidebar-ad-box {
    background-color: var(--bg-workspace);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    transition: all var(--transition-fast);
    min-height: 400px; /* Increased ad height as requested */
}

.sidebar-ad-box:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.sidebar-ad-box .ad-icon {
    width: 2rem;
    height: 2rem;
    color: var(--text-muted);
}

.sidebar-ad-box .ad-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.sidebar-ad-box .ad-dims {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Dashboard & Workspace Leaderboard Ad Box */
.dashboard-ad-container,
.workspace-ad-container {
    margin: 2rem auto;
    max-width: 728px;
    width: 100%;
}

.workspace-ad-container {
    margin: 3rem auto 1rem auto;
}

.dashboard-ad-box,
.workspace-ad-box {
    background-color: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 200px; /* Increased leaderboard ad height to 200px (Billboard size) */
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.dashboard-ad-box:hover,
.workspace-ad-box:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.ad-icon-small {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ad-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ad-text-content .ad-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.ad-text-content .ad-dims {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

@media (max-width: 767px) {
    .dashboard-ad-box,
    .workspace-ad-box {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .ad-text-content {
        align-items: center;
    }
}

/* Lucide Icon Pack Styling overrides */
svg.lucide {
    stroke-width: 2px;
    stroke: currentColor;
    fill: none;
    transition: transform var(--transition-fast), stroke var(--transition-fast);
}

/* Header & Toggle items */
.theme-toggle svg.lucide {
    width: 1.25rem;
    height: 1.25rem;
}

/* Upload cloud spinner or anim */
.upload-icon-wrapper svg.lucide {
    width: 2.5rem;
    height: 2.5rem;
}

/* Dashboard tool icon overrides */
.tool-card-icon svg.lucide {
    width: 1.5rem;
    height: 1.5rem;
}

/* Left sidebar menu custom styles */
.nav-item-icon svg.lucide {
    width: 1.15rem;
    height: 1.15rem;
    stroke: var(--text-muted);
}

.nav-item:hover .nav-item-icon svg.lucide {
    stroke: var(--primary);
    transform: scale(1.05);
}

.nav-item.active .nav-item-icon svg.lucide {
    stroke: #e52254;
}

[data-theme="dark"] .nav-item.active .nav-item-icon svg.lucide {
    stroke: #ff4d79;
}

/* Category header icons styling */
.nav-group-title-icon svg.lucide {
    width: 1.15rem;
    height: 1.15rem;
    stroke: #e52254;
}

.nav-group:last-child .nav-group-title-icon svg.lucide {
    stroke: var(--primary);
}

/* Brand icon in sidebar */
svg.nav-sidebar-logo-icon {
    width: 1.35rem;
    height: 1.35rem;
    stroke: white;
    fill: white;
}

/* General layout action items */
.workspace-back-btn svg.lucide,
.workspace-nav-toggle svg.lucide {
    width: 1.15rem;
    height: 1.15rem;
}

.sidebar-btn svg.lucide {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform var(--transition-fast);
}

.sidebar-btn:hover svg.lucide {
    transform: translateX(3px);
}

.modal-close svg.lucide {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-title svg.lucide {
    width: 1.5rem;
    height: 1.5rem;
}

.ad-icon svg.lucide,
.ad-icon-small svg.lucide {
    width: 100%;
    height: 100%;
}
