/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
    :root {
    /* Color Palette - Refined Apple Style */
    --primary-blue: #007aff;
    --primary-blue-dark: #0056b3;
    --primary-gradient: linear-gradient(135deg, #007aff 0%, #00c6ff 100%);
    
    --bg-main: #f5f5f7; /* Apple's signature off-white */
    --bg-header: rgba(255, 255, 255, 0.7);
    --bg-footer: #f5f5f7;
    --bg-card: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-elevated: #ffffff;
    
    --text-main: #1d1d1f; /* Apple's dark text color */
    --text-muted: #86868b; /* Apple's secondary text */
    --text-light: #f5f5f7;
    
    /* Semantic Colors */
    --color-green: #34c759;
    --color-green-light: rgba(52, 199, 89, 0.1);
    
    --color-blue: #007aff;
    --color-blue-light: rgba(0, 122, 255, 0.1);
    
    --color-orange: #ff9500;
    --color-orange-light: rgba(255, 149, 0, 0.1);
    
    --color-purple: #af52de;
    --color-purple-light: rgba(175, 82, 222, 0.1);
    
    --color-teal: #5ac8fa;
    --color-teal-light: rgba(90, 200, 250, 0.1);
    
    --color-red: #ff3b30;
    --color-red-light: rgba(255, 59, 48, 0.1);
    
    /* Glassmorphism & Effects */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --blur-intensity: 20px;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
    
    /* Shadows & Borders - Softer & Deeper */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.04);
    
    --border-radius-sm: 10px;
    --border-radius-md: 18px;
    --border-radius-lg: 28px;
    --border-radius-full: 9999px;
    
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Dark Mode Variables - Midnight Obsidian */
[data-theme="dark"] {
    --bg-main: #0f1115;
    --bg-header: rgba(15, 17, 21, 0.85);
    --bg-footer: #0f1115;
    --bg-card: #16181d;
    --bg-secondary: #1c1f26;
    --bg-elevated: #23272f;
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.08);
    
    --glass-bg: rgba(22, 24, 29, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.3);

    /* Muted semantic backgrounds for dark mode */
    --color-green-light: rgba(52, 199, 89, 0.15);
    --color-blue-light: rgba(0, 122, 255, 0.15);
    --color-orange-light: rgba(255, 149, 0, 0.15);
    --color-purple-light: rgba(175, 82, 222, 0.15);
    --color-teal-light: rgba(90, 200, 250, 0.15);
    --color-red-light: rgba(255, 59, 48, 0.15);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

/* Global Animations Library - Apple Style */
@keyframes appleViewEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes appleViewExit {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.02);
        filter: blur(5px);
    }
}

.view-enter {
    animation: appleViewEnter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    will-change: transform, opacity, filter;
}

.view-exit {
    animation: appleViewExit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity, filter;
}

.viewFadeIn {
    animation: appleViewEnter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes springIn {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    100% { transform: scale(0.96); }
}

@keyframes glassShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Premium Card Glow & Magnetic Feel */
.tool-card {
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.tool-card:hover::before {
    opacity: 1;
}

[data-theme="dark"] .tool-card::before {
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.1),
        transparent 40%
    );
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-intensity)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-intensity)) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Micro-Interactions */
button, .btn, .tool-card, .btn-tool, .ribbon-btn-pro {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active, .btn:active, .btn-tool:active, .ribbon-btn-pro:active {
    transform: scale(0.96) !important;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-blue);
}

.tool-card:active {
    transform: translateY(-4px) scale(0.98);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

#dashboard-view, #tool-view {
    animation: viewFadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pdf-tool-container {
    animation: none !important; 
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* Selection Style for PDF to Image */
.p2i-preview-item {
    position: relative;
    background: var(--bg-card);
    padding: 12px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.p2i-preview-item:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.p2i-preview-item.selected {
    border-color: var(--primary-blue) !important;
    background: var(--color-blue-light);
}

.p2i-selection-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #e2e8f0;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 5;
    transition: all 0.2s;
    border: 2px solid white;
}

.p2i-preview-item.selected .p2i-selection-badge {
    background: #3b82f6;
}

.p2i-preview-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}


/* Custom Scrollbar - Apple Style */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--bg-main);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: var(--bg-main);
    color-scheme: dark; /* Hint to browser for dark scrollbars etc */
}

a {
    text-decoration: none;
    color: inherit;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 40px 40px 30px 40px;
    background-color: var(--bg-main);
    min-height: calc(100vh - 70px);
    position: relative;
    z-index: 1;
}

/* Utilities */
.text-green { color: var(--color-green); }
.text-blue { color: var(--color-blue); }
.text-orange { color: var(--color-orange); }
.text-purple { color: var(--color-purple); }

.bg-green-light { background-color: var(--color-green-light); }
.bg-blue-light { background-color: var(--color-blue-light); }
.bg-orange-light { background-color: var(--color-orange-light); }
.bg-purple-light { background-color: var(--color-purple-light); }

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.site-header {
    background-color: var(--bg-header) !important;
    backdrop-filter: blur(var(--blur-intensity)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-intensity)) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adaptive Scroll Removed */

.header-search {
    position: relative;
    width: 420px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-blue);
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.6;
}

.header-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.header-search input:hover {
    background: var(--bg-card);
    border-color: var(--primary-blue);
}

[data-theme="dark"] .header-search input {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Apple Spotlight Search Modal */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 11000;
    display: none; /* Hidden by default */
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal-container {
    width: 800px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: spotlightScale 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

@keyframes spotlightScale {
    0% { opacity: 0; transform: scale(0.95) translateY(-20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-header);
    gap: 16px;
}

.search-modal-header i {
    font-size: 20px;
    color: var(--primary-blue);
}

.search-modal-header input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-main);
}

.search-shortcut-hint {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    min-width: 35px;
    text-align: center;
}

.search-results-container {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
}

.search-results-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 12px 16px 8px;
    opacity: 0.7;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.search-result-item:hover, .search-result-item.selected {
    background: var(--primary-gradient);
    transform: translateX(6px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.2);
}

.search-result-item:hover *, .search-result-item.selected * {
    color: white !important;
}

/* Fix icon visibility when selected */
.search-result-item:hover .result-icon, 
.search-result-item.selected .result-icon {
    background: rgba(255, 255, 255, 0.15) !important;
}

.result-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-main);
    transition: background 0.2s;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-modal-footer {
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
}

.footer-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-hint span {
    background: var(--bg-main);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.header-container {
    max-width: none;
    margin: 0;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.logo:active {
    transform: scale(0.98);
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 10px; /* Apple squircle-like */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Consolidated into line 339 */

.badge-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-green-light);
    color: var(--color-green);
    padding: 6px 16px;
    border-radius: var(--border-radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.badge-status:hover {
    background-color: var(--color-green);
    color: white;
}

.theme-toggle-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-blue-light);
    padding: 8px 18px;
    border-radius: var(--border-radius-full);
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.theme-toggle-pill:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.theme-toggle-pill:active {
    transform: scale(0.95);
}

.theme-toggle-pill i {
    font-size: 1.2rem;
    color: var(--primary-blue);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-pill span {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s;
}

/* State Dark Mode untuk Pill */
[data-theme="dark"] .theme-toggle-pill {
    background: rgba(175, 82, 222, 0.15); /* Purple/Indigo glow */
    border-color: rgba(175, 82, 222, 0.3);
}

[data-theme="dark"] .theme-toggle-pill i {
    color: #af52de;
    transform: rotate(360deg);
}

[data-theme="dark"] .theme-toggle-pill span {
    color: #af52de;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green {
    background-color: var(--color-green);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--color-blue-light);
    color: var(--primary-blue);
    border-color: var(--color-blue-light);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    background: var(--bg-elevated);
    border-radius: var(--border-radius-lg);
    padding: 80px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, rgba(0, 198, 255, 0.05) 50%, transparent 100%);
    z-index: 1;
    filter: blur(60px);
    pointer-events: none;
}

.hero-content {
    max-width: 850px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-blue-light);
    color: var(--primary-blue);
    padding: 8px 18px;
    border-radius: var(--border-radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 24px;
    border: 1px solid transparent;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 24px;
    letter-spacing: -0.05em;
    color: var(--text-main);
    background: linear-gradient(180deg, var(--text-main) 30%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.5;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    text-decoration: none !important;
}

.btn:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 25px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 15px 35px rgba(0, 122, 255, 0.3);
}

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

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-white-outline {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-white-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--text-main);
}

.hero-illustration {
    position: relative;
    z-index: 1;
}

.shield-container {
    width: 240px;
    height: 240px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 60px; /* Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.shield-icon {
    font-size: 110px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 20px rgba(0, 122, 255, 0.2));
}

/* ==========================================================================
   Stats Grid - Apple Bento Style
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
    position: relative;
    z-index: 10;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 32px; /* Super soft corners */
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 200px;
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--bg-elevated);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px; /* Apple Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--bg-secondary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.stat-info p {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Tools Section
   ========================================================================== */
.tools-section {
    margin-top: 60px;
}

.tools-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 0.5px solid var(--border-color);
}

.tools-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.tools-header h2 i {
    width: 32px;
    height: 32px;
    background: var(--color-red-light);
    color: var(--color-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}


/* Category Headers */
.tools-category-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 40px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-category-title i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

#searchInput {
    width: 100%;
    padding: 18px 18px 18px 56px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

#searchInput:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--color-blue-light);
    transform: translateY(-2px);
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: var(--border-radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.filter-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* ==========================================================================
   Tool Cards Grid
   ========================================================================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: var(--bg-elevated);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .tool-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .tool-card:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-blue);
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-card[data-category*="pdf"] .tool-icon { background: var(--color-orange-light); color: var(--color-orange); }
.tool-card[data-category*="gambar"] .tool-icon { background: var(--color-green-light); color: var(--color-green); }
.tool-card[data-category*="keamanan"] .tool-icon { background: var(--color-purple-light); color: var(--color-purple); }

.tool-card.maintenance {
    opacity: 0.8;
    position: relative;
    overflow: hidden;
}

.tool-card.maintenance:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
    cursor: default !important;
}


.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px; /* High-end Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.05);
}

.tool-card:hover .tool-icon {
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.tool-card-body, .tool-card-header, .tool-card-footer {
    position: relative;
    z-index: 2;
}

.tool-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    background-color: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
}

/* Neutral badges */
.badge-purple, .badge-green, .badge-blue, .badge-green-light { 
    background-color: #e2e8f0;
    color: #334155;
}

.tool-card-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.tool-card-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    text-align: left;
}

.tool-card-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.btn-tool {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 122, 255, 0.15);
    background: rgba(0, 122, 255, 0.05);
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-card:hover .btn-tool {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

/* Specific Card Borders Removed */

/* ==========================================================================
   Activity & Privacy Sections
   ========================================================================== */
.activity-section {
    margin-top: 40px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.activity-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.btn-clear:hover {
    background: var(--color-red-light);
    color: var(--color-red);
    border-color: var(--color-red-light);
}

.activity-body p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 20px 0;
}

/* ==========================================================================
   Modern Privacy Section
   ========================================================================== */
.privacy-section {
    margin-top: 60px;
    padding: 60px 40px;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

[data-theme="dark"] .privacy-section {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.privacy-header {
    text-align: center;
    margin-bottom: 40px;
}

.privacy-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 12px;
}

.privacy-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.privacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.privacy-item {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 28px;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] .privacy-item {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.privacy-item:hover {
    background: var(--bg-card);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.privacy-item-icon {
    width: 44px;
    height: 44px;
    background: var(--color-blue-light);
    color: var(--primary-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.privacy-item h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.privacy-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tool-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.tool-type {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-blue);
    letter-spacing: 0.08em;
    background: var(--color-blue-light);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--color-blue-light);
}

/* How It Works Themed Cards */
.how-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.how-blue { background: var(--bg-card); }
.how-blue .how-icon { background: var(--primary-blue); color: white; }
.how-blue h4 { color: var(--primary-blue); }

.how-green { background: var(--bg-card); }
.how-green .how-icon { background: var(--color-green); color: white; }
.how-green h4 { color: var(--color-green); }

.how-yellow { background: var(--bg-card); }
.how-yellow .how-icon { background: var(--color-orange); color: white; }
.how-yellow h4 { color: var(--color-orange); }

.how-purple { background: var(--bg-card); }
.how-purple .how-icon { background: var(--color-purple); color: white; }
.how-purple h4 { color: var(--color-purple); }

/* Updated Footer */
.site-footer {
    background-color: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    width: 100%;
    padding: 30px 0;
    transition: none;
}

.footer-container {
    max-width: none;
    margin: 0;
    padding: 0 40px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon.small {
    width: 24px;
    height: 24px;
    font-size: 14px;
}




.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.03);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-social {
    display: flex;
    gap: 16px;
}

.social-link {
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

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

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 1000;
    padding: 20px;
    overflow-y: scroll !important; /* Force scrollbar area */
    -webkit-overflow-scrolling: touch;
}

.modal-box {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 950px;
    margin: 40px auto; /* Center with margin */
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-header);
    flex-shrink: 0;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px; /* Squircle */
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0;
}

.modal-close {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 20px;
}

.modal-close:hover {
    background: var(--color-red-light);
    color: var(--color-red);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    background-color: var(--bg-secondary);
    overflow: visible; /* Let content flow naturally */
}

.pdf-tool-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    flex-shrink: 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-green);
}

/* ==========================================================================
   Tool Workspaces (Inside Modal)
   ========================================================================== */
.tool-workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.upload-container {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 60px 20px;
    text-align: center;
    margin: 20px;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-container .btn-upload {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

.upload-container .btn-upload:hover {
    background-color: var(--primary-blue-dark);
}

.editor-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-main);
    overflow: hidden;
}

.editor-toolbar {
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    z-index: 10;
}

.editor-sub-toolbar {
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 9;
}

.prop-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 16px;
    border-right: 1px solid var(--border-color);
}
.prop-group:last-child {
    border-right: none;
}

.prop-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.prop-btn:hover { background-color: var(--border-color); }
.prop-btn.active { background-color: var(--color-blue-light); color: var(--primary-blue); border-color: var(--color-blue-light); }

.prop-select {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
}

.editor-main-workspace {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.editor-sidebar {
    width: 220px;
    background-color: var(--bg-main);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    gap: 20px;
    z-index: 5;
}

/* Custom Ribbon Button Styling */
.ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 70px;
    gap: 6px;
}

.ribbon-btn:hover {
    background: rgba(0, 122, 255, 0.05);
    color: var(--primary-blue);
}

.ribbon-btn i {
    font-size: 1.4rem;
    color: var(--text-main);
    transition: transform 0.2s;
}

.ribbon-btn:hover i {
    transform: translateY(-2px);
    color: var(--primary-blue);
}

.ribbon-btn span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ribbon-btn.primary, #btn-export-pdf {
    background: var(--primary-gradient);
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.ribbon-btn.primary i, .ribbon-btn.primary span, #btn-export-pdf i, #btn-export-pdf span {
    color: white !important;
}

.ribbon-btn.primary:hover, #btn-export-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

.ribbon-btn:active {
    transform: scale(0.95);
}

/* Page Shadow */
canvas, .canvas-container {
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06) !important;
    margin-bottom: 40px;
}

.pdf-thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}
.pdf-thumbnail-item.active, .pdf-thumbnail-item:hover {
    opacity: 1;
}
.pdf-thumbnail-item.active .thumb-canvas-wrapper {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px var(--color-blue-light);
}
.thumb-canvas-wrapper {
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
    background: var(--bg-card);
}
.thumb-canvas-wrapper canvas {
    display: block;
    max-width: 140px;
    height: auto;
}
.thumb-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 4px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.tool-btn.active {
    background-color: var(--color-blue-light);
    color: var(--primary-blue);
}

.tool-btn.text-red:hover {
    background-color: var(--color-red-light);
    color: var(--color-red);
}

.properties-panel {
    margin-left: 16px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#page-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.ml-4 {
    margin-left: 16px;
}

.canvas-container-wrapper {
    flex-grow: 1;
    overflow: auto;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    min-height: 500px;
}

#pdf-bg-canvas {
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
}

/* Fabric canvas wrapper styling */
.canvas-container {
    position: absolute !important;
    top: 24px; /* match padding */
    box-shadow: none !important;
}

@media (max-width: 1024px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 20px;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    
    .hero-badge {
        margin: 0 auto 24px auto;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
    }
    
    .hero-illustration {
        margin-top: 40px;
        transform: scale(0.8);
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-actions {
        display: none; /* Hide on mobile for simplicity, or add a hamburger menu */
    }
}

/* ==========================================================================
   Document Tabs (Nitro Style)
   ========================================================================== */
.doc-tabs-bar {
    background: var(--bg-secondary);
    display: flex;
    align-items: flex-end;
    padding: 6px 12px 0 12px;
    gap: 4px;
    height: 40px;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .doc-tabs-bar {
    background: var(--bg-main);
}

.doc-tab {
    background: var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    max-width: 250px;
    min-width: 120px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.doc-tab span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-color);
}

.doc-tab i.ph-file {
    font-size: 14px;
    color: var(--primary-blue);
}

.doc-tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #94a3b8;
}

.doc-tab-close:hover {
    background: var(--color-red-light);
    color: var(--color-red);
}


.doc-tab.tool-name-tab {
    background: var(--text-muted);
    color: white;
}

.doc-tab.tool-name-tab.active {
    background: var(--primary-blue);
    color: white;
}

.btn-add-tab {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Bulat seperti Chrome */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* Hilangkan kotak */
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px; 
    border: none;
    font-size: 18px;
}

.btn-add-tab:hover {
    background: var(--border-color); /* Sedikit bayangan saat hover */
    color: var(--primary-blue);
}

[data-theme="dark"] .btn-add-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ==========================================================================
   Ribbon UI (Nitro/Office Style)
   ========================================================================== */
.editor-ribbon {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ribbon-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px 0 16px;
    background: var(--bg-secondary);
}

[data-theme="dark"] .ribbon-tabs {
    background: var(--bg-main);
}

.ribbon-tab {
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    border: 1px solid transparent;
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ribbon-tab:hover {
    color: var(--text-main);
    background: var(--bg-card);
    opacity: 0.8;
}

.ribbon-tab.active {
    background: var(--bg-card);
    color: var(--primary-blue);
    border-color: var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.ribbon-content {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    min-height: 85px;
}

.ribbon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.ribbon-group:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 10%;
    height: 80%;
    width: 1px;
    background: var(--border-color);
}

.ribbon-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ribbon-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Ribbon Tool Button */
.ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 64px;
}

.ribbon-btn i {
    font-size: 20px;
}

.ribbon-btn span {
    font-size: 0.7rem;
    font-weight: 600;
}

.ribbon-btn:hover {
    background: var(--color-blue-light);
    color: var(--primary-blue);
}

.ribbon-btn.active {
    background: var(--color-blue-light);
    color: var(--primary-blue);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
}

/* Ensure editor layout fills space without padding */
.tool-workspace:has(.editor-layout) {
    height: 100%;
}

.pdf-tool-container:has(.editor-layout) {
    padding: 0;
    justify-content: flex-start;
}

.ribbon-btn.large {
    min-width: 80px;
    padding: 10px;
}

.ribbon-btn.large i {
    font-size: 28px;
}

/* Secondary Actions inside Ribbon */
.ribbon-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .zoom-controls {
    background: var(--bg-secondary);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 6px;
}

.zoom-btn:hover {
    background: var(--bg-card);
}

[data-theme="dark"] .zoom-btn:hover {
    background: var(--bg-card);
}

/* Tab Panels */
.ribbon-panel {
    display: none;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.ribbon-panel.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

/* PDF Tools Styling */
.pdf-tool-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-main);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.upload-area {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    min-width: 600px;
    max-width: 800px;
    margin: auto; /* This centers it vertically and horizontally in a flex parent */
}

.upload-area:hover {
    border-color: var(--primary-blue);
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.upload-area i {
    font-size: 56px;
    margin-bottom: 20px;
    display: block;
}

.upload-area h3 {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* Button inside upload area (match screenshot) */
.upload-area .btn-primary {
    background: var(--bg-card);
    color: var(--primary-blue);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 12px 32px;
    font-weight: 700;
    border-radius: 10px;
}

.upload-area .btn-primary:hover {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

.file-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    color: var(--text-main);
}

.file-list-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.thumb-preview {
    width: 60px;
    height: 80px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--text-muted);
    cursor: grab;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.image-grid div.img-thumb-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    padding: 5px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.prop-select {
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.prop-select:focus {
    border-color: var(--primary-blue);
}

/* Modal dark mode specific override */
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background-color: var(--bg-header);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-body {
    background-color: var(--bg-main);
}

[data-theme="dark"] .split-thumb-item {
    background: var(--bg-secondary) !important;
}

/* Animations */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   PDF Tools UI Components
   ========================================================================== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.img-thumb-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    text-align: center;
}

.img-thumb-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.img-thumb-container img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-grid-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Button Icon Style */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--color-blue-light);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.btn-icon.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.btn-icon.text-red:hover {
    background: var(--color-red-light);
    color: var(--color-red);
    border-color: var(--color-red);
}

/* Rotate Item UI */
.rotate-item-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .rotate-item-wrapper {
    background: var(--bg-card) !important;
}

[data-theme="dark"] .btn-icon {
    background: var(--bg-secondary);
    color: var(--text-main);
}

/* ==========================================================================
   Refined Cara Kerja Modal Styling
   ========================================================================== */
.how-it-works-modal {
    max-width: 600px !important; /* Make it narrower */
}

.how-it-works-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 24px; /* Added 24px horizontal padding */
}

.how-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
}

.how-card:hover {
    transform: translateX(8px);
    background: var(--bg-card);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

[data-theme="dark"] .how-card:hover {
    background: var(--bg-secondary);
}

.how-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.how-info h4 {
    margin-bottom: 2px;
    font-size: 0.95rem;
    font-weight: 700;
}

.how-info p {
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.8;
}

/* Softer Colors for How Cards */
.how-blue { background: var(--bg-card); border-color: var(--border-color); color: var(--primary-blue); }
.how-blue .how-icon { background: var(--color-blue-light); color: var(--primary-blue); }

.how-green { background: var(--bg-card); border-color: var(--border-color); color: var(--color-green); }
.how-green .how-icon { background: var(--color-green-light); color: var(--color-green); }

.how-yellow { background: var(--bg-card); border-color: var(--border-color); color: var(--color-orange); }
.how-yellow .how-icon { background: var(--color-orange-light); color: var(--color-orange); }

.how-purple { background: var(--bg-card); border-color: var(--border-color); color: var(--color-purple); }
.how-purple .how-icon { background: var(--color-purple-light); color: var(--color-purple); }

/* Dark mode overrides */
[data-theme="dark"] .how-blue { background: rgba(14, 165, 233, 0.05); border-color: rgba(14, 165, 233, 0.1); color: #7dd3fc; }
[data-theme="dark"] .how-green { background: rgba(34, 197, 94, 0.05); border-color: rgba(34, 197, 94, 0.1); color: #86efac; }
[data-theme="dark"] .how-yellow { background: rgba(234, 179, 8, 0.05); border-color: rgba(234, 179, 8, 0.1); color: #fde047; }
[data-theme="dark"] .how-purple { background: rgba(168, 85, 247, 0.05); border-color: rgba(168, 85, 247, 0.1); color: #d8b4fe; }

/* Subtitle Styling */
.modal-subtitle-clean {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   Tool View (SPA Mode)
   ========================================================================== */
#tool-view {
    position: fixed; /* Use fixed to create an independent scroll context */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main); /* Ensure it covers everything */
    z-index: 9999;
    overflow-y: auto; /* This becomes the primary scroll container */
    overflow-x: hidden;
    animation: fadeIn 0.4s ease-out forwards;
}

/* Ensure tool view scrollbar is visible */
#tool-view::-webkit-scrollbar {
    width: 10px;
}
#tool-view::-webkit-scrollbar-track {
    background: var(--bg-main);
}
#tool-view::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}
#tool-view::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.tool-view-container {
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    border: none;
    overflow: visible;
    position: relative;
}

.tool-view-body {
    width: 100%;
    overflow: visible;
}

.tool-view-header {
    padding: 16px 30px;
    background: var(--bg-header);
    backdrop-filter: blur(var(--blur-intensity)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-intensity)) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--border-radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-back:hover {
    background: var(--bg-secondary);
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}

.btn-back:active {
    transform: scale(0.95) translateX(-4px);
}

.tool-view-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.tool-view-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--color-blue-light);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.tool-view-title-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.tool-view-body {
    flex-grow: 1;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

[data-theme="dark"] .tool-view-body {
    background: var(--bg-main);
}

.tool-view-actions .footer-status {
    background: var(--color-green-light);
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-full);
    color: var(--color-green);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

/* ==========================================================================
   Proper Upload Area & Tool Container
   ========================================================================== */
.pdf-tool-container {
    width: 100%;
    max-width: 900px; /* Keep content centered and neat */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    flex-grow: 1;
}

.upload-area {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 80px 40px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    position: relative;
    box-shadow: var(--shadow-card);
}

.upload-area:hover {
    border-color: var(--primary-blue);
    background: var(--color-blue-light);
    transform: scale(1.01) translateY(-4px);
}

.upload-area:hover {
    border-color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.02);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.upload-area i {
    font-size: 64px;
    color: var(--primary-blue);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.upload-area:hover i {
    transform: scale(1.1);
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.upload-area p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

.upload-area .btn {
    margin-top: 10px;
    padding: 14px 32px;
}

[data-theme="dark"] .upload-area {
    background: rgba(30, 41, 59, 0.5);
    border-color: #334155;
}

[data-theme="dark"] .upload-area:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Override for after-upload view */
.file-list-container, 
.rotate-preview-container, 
.preview-grid-container, 
.editor-layout,
.pdf-to-img-workspace {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

.pdf-tool-container:has(.file-list-container:not([style*="display: none"])),
.pdf-tool-container:has(.rotate-preview-container:not([style*="display: none"])),
.pdf-tool-container:has(.preview-grid-container:not([style*="display: none"])) {
    justify-content: flex-start;
    padding: 24px;
}

/* Merge PDF & File Lists */
.file-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.file-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.file-list-item:hover {
    box-shadow: var(--shadow-card);
    border-color: var(--primary-blue);
    transform: scale(1.01);
}

.thumb-preview {
    width: 60px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.thumb-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-info-main {
    flex-grow: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-range {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    width: 160px;
    outline: none;
    transition: border-color 0.2s;
}

.input-range:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--color-blue-light);
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action-sm {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-sm:hover {
    background: var(--color-blue-light);
    color: var(--primary-blue);
}

.btn-action-sm.btn-remove:hover {
    background: var(--color-red-light);
    color: var(--color-red);
}

/* Modal Preview Grid */
.preview-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 10px;
}

.preview-page-item {
    text-align: center;
}

.preview-page-item img {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preview-page-num {
    font-size: 0.7rem;
    font-weight: bold;
    color: #64748b;
    margin-top: 5px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-card);
    width: 95%;
    max-width: 600px;
    border-radius: 32px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transform: scale(0.9);
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-main);
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

@keyframes scaleUp {
    to { transform: scale(1); }
}

/* PDF to Text Specific Styles */
#pdf-to-text-result::-webkit-scrollbar,
#p2t-preview-container::-webkit-scrollbar {
    width: 8px;
}
#pdf-to-text-result::-webkit-scrollbar-track,
#p2t-preview-container::-webkit-scrollbar-track {
    background: var(--bg-main);
}
#pdf-to-text-result::-webkit-scrollbar-thumb,
#p2t-preview-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
#pdf-to-text-result::-webkit-scrollbar-thumb:hover,
#p2t-preview-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

@keyframes glassShimmer {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(200%) skewX(-15deg); }
}

@keyframes blobMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.shimmer {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0.08) 37%, 
        rgba(255,255,255,0.03) 63%);
    background-size: 400% 100%;
    animation: glassShimmer 1.4s infinite linear;
}

[data-theme="light"] .shimmer {
    background: linear-gradient(90deg, 
        #f1f5f9 25%, 
        #f8fafc 37%, 
        #f1f5f9 63%);
    background-size: 400% 100%;
}

[data-theme="dark"] .shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 100%);
}

/* Dynamic Background */
.dynamic-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    filter: blur(100px);
    opacity: 0.5;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    animation: blobMove 15s infinite alternate ease-in-out;
}

.blob-1 { width: 500px; height: 500px; background: #007aff; top: -100px; right: -100px; opacity: 0.3; animation-delay: 0s; }
.blob-2 { width: 400px; height: 400px; background: #5ac8fa; bottom: -50px; left: -50px; opacity: 0.2; animation-delay: -5s; }
.blob-3 { width: 600px; height: 600px; background: #af52de; top: 40%; left: 30%; opacity: 0.15; animation-delay: -10s; }
.blob-4 { width: 300px; height: 300px; background: #34c759; bottom: 20%; right: 20%; opacity: 0.1; animation-delay: -3s; }

/* Interactive Glow Card */
.tool-card, .stat-card {
    position: relative;
    overflow: hidden;
}

.tool-card::before, .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.15),
        transparent 40%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tool-card:hover::before {
    opacity: 1;
}

[data-theme="dark"] .tool-card::before {
    background: radial-gradient(
        600px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.08),
        transparent 40%
    );
}

/* Adaptive Header */
.site-header.scrolled {
    background-color: var(--bg-header) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border-bottom: 0.5px solid var(--border-color);
    padding: 10px 40px;
    box-shadow: var(--shadow-md) !important;
}

/* Premium Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s, 
                filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    filter: blur(20px);
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.preloader-logo {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
    animation: pulseLogo 2s infinite ease-in-out;
}

.preloader-bar-container {
    width: 180px;
    height: 3px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.preloader-bar {
    width: 0;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    animation: fillProgress 2.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.preloader-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.6;
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.1); }
}

@keyframes fillProgress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.pulse-animation {
    animation: pulse 2s infinite;
}

.export-opt:hover {
    background: var(--bg-secondary);
    color: var(--primary-blue) !important;
}

/* ==========================================================================
   Responsive & Mobile Optimization
   ========================================================================== */

/* Standard Grid for Tools */
.tool-workspace-grid {
    display: grid; 
    grid-template-columns: 350px 1fr; 
    gap: 30px;
}

@media (max-width: 1024px) {
    .tool-workspace-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pdf-tool-container {
        padding: 10px !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .site-header {
        padding: 15px 20px !important;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .app-container {
        padding: 80px 15px 40px 15px;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 24px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .footer-attribution {
        text-align: center !important;
        align-items: center !important;
    }
    
    .footer-attribution div {
        align-items: center !important;
    }
    
    /* Navigation Pill */
    .theme-toggle-pill {
        transform: scale(0.9);
    }
    
    .badge-status {
        display: none !important;
    }
    
    .header-search {
        display: none !important;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    #pnum-visual-marker {
        padding: 10px 15px !important;
        font-size: 16px !important;
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .tool-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 16px !important;
    }
    
    .btn-back {
        width: auto;
        padding: 8px 14px;
        font-size: 0.75rem;
    }
    
    .tool-view-title-wrapper {
        margin: 5px 0;
        gap: 10px;
    }
    
    .tool-view-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .tool-view-title-text h2 {
        font-size: 1rem;
    }
    
    .tool-view-title-text p {
        font-size: 0.65rem;
    }
    
    .tool-view-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    
    .footer-status {
        font-size: 0.7rem;
        padding: 4px 10px;
        background: var(--bg-secondary);
        border-radius: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
        margin: 10px;
    }
    
    .upload-area i {
        font-size: 50px !important;
    }
    
    .upload-text h3 {
        font-size: 1.1rem;
    }
    
    .upload-text p {
        font-size: 0.8rem;
    }
}

/* Fluid Grids */
.fluid-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.fluid-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.fluid-grid-p2t {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

.fluid-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .fluid-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .fluid-grid-2 { grid-template-columns: 1fr; gap: 20px; }
    .fluid-grid-p2t { grid-template-columns: 1fr; height: auto !important; min-height: unset !important; }
}

@media (max-width: 768px) {
    .fluid-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .fluid-grid-3 { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 480px) {
    .fluid-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* End of file - Cleaned redundant animations */

/* ==========================================================================
   Super Editor Workspace Styles
   ========================================================================== */
.editor-workspace {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    overflow: hidden;
    background: var(--bg-main);
}

.ribbon-btn-pro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 8px;
    min-width: 60px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.ribbon-btn-pro i {
    font-size: 18px;
    color: var(--primary-blue);
}

.ribbon-btn-pro span {
    font-size: 0.6rem;
    font-weight: 700;
}

.ribbon-btn-pro:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.ribbon-btn-pro.large {
    min-width: 100px;
    padding: 15px 10px;
}

.ribbon-btn-pro.large i {
    font-size: 32px;
}

/* Sidebar & Thumbnails */
.editor-sidebar-left {
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    z-index: 10;
}

.thumbnail-item {
    width: 140px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.thumbnail-item:hover {
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: var(--primary-blue);
    background: var(--color-blue-light);
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.2);
}

.thumbnail-canvas {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.thumbnail-number {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* Status Bar Controls */
.status-btn:hover {
    color: var(--primary-blue) !important;
    transform: scale(1.2);
}

/* Responsive adjustments for Super Editor */
@media (max-width: 768px) {
    .editor-sidebar-left {
        width: 80px !important;
    }
    .editor-sidebar-left span, .sidebar-header span {
        display: none;
    }
    .thumbnail-item {
        width: 60px;
        padding: 5px;
    }
    .ribbon-content {
        padding: 10px !important;
        overflow-x: auto;
    }
    .ribbon-group-label {
        display: none;
    }
}

/* Document Tabs Styles */
.editor-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    max-width: 200px;
    min-width: 120px;
    transition: all 0.2s;
    position: relative;
    margin-top: 5px;
}

.editor-tab i {
    font-size: 1rem;
    color: var(--primary-blue);
}

.editor-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-tab:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.editor-tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    border-top: 2px solid var(--primary-blue);
}

.tab-close {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    margin-left: auto;
}

.tab-close:hover {
    background: var(--color-red-light);
    color: var(--color-red);
@media (max-width: 768px) {
    .fluid-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .fluid-grid-3 { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 480px) {
    .fluid-grid-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* End of file - Cleaned redundant animations */

/* ==========================================================================
   Super Editor Workspace Styles
   ========================================================================== */
.editor-workspace {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    overflow: hidden;
    background: var(--bg-main);
}

.ribbon-btn-pro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 8px;
    min-width: 60px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.ribbon-btn-pro i {
    font-size: 18px;
    color: var(--primary-blue);
}

.ribbon-btn-pro span {
    font-size: 0.6rem;
    font-weight: 700;
}

.ribbon-btn-pro:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.ribbon-btn-pro.large {
    min-width: 100px;
    padding: 15px 10px;
}

.ribbon-btn-pro.large i {
    font-size: 32px;
}

/* Sidebar & Thumbnails */
.editor-sidebar-left {
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    z-index: 10;
}

.thumbnail-item {
    width: 140px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.thumbnail-item:hover {
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: var(--primary-blue);
    background: var(--color-blue-light);
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.2);
}

.thumbnail-canvas {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.thumbnail-number {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* Status Bar Controls */
.status-btn:hover {
    color: var(--primary-blue) !important;
    transform: scale(1.2);
}

/* Responsive adjustments for Super Editor */
@media (max-width: 768px) {
    .editor-sidebar-left {
        width: 80px !important;
    }
    .editor-sidebar-left span, .sidebar-header span {
        display: none;
    }
    .thumbnail-item {
        width: 60px;
        padding: 5px;
    }
    .ribbon-content {
        padding: 10px !important;
        overflow-x: auto;
    }
    .ribbon-group-label {
        display: none;
    }
}

/* Document Tabs Styles */
.editor-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    max-width: 200px;
    min-width: 120px;
    transition: all 0.2s;
    position: relative;
    margin-top: 5px;
}

.editor-tab i {
    font-size: 1rem;
    color: var(--primary-blue);
}

.editor-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-tab:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.editor-tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    border-top: 2px solid var(--primary-blue);
}

.tab-close {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    margin-left: auto;
}

.tab-close:hover {
    background: var(--color-red-light);
    color: var(--color-red);
}

/* ==========================================================================
   Tools Catalog Modal (Pop-up System)
   ========================================================================== */
.catalog-modal-overlay#preloader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.catalog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.catalog-modal-content {
    background: var(--bg-card);
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.catalog-modal-header {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.catalog-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.btn-close-modal {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: var(--color-red-light);
    color: var(--color-red);
    transform: rotate(90deg);
}

.catalog-search-wrapper {
    padding: 16px 32px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 32px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.catalog-search-wrapper i {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.catalog-search-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    color: var(--text-main);
    font-size: 1rem;
}

.catalog-grid {
    padding: 0 32px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    overflow-y: auto;
}

.catalog-item {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.catalog-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.catalog-item-info h4 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.catalog-item-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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