:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 30px -10px rgba(0,0,0,0.12);
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: #fcfdfe;
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-clock-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
    background: var(--gray-100);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
}

.clock-live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.lang-selector-group {
    display: flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--gray-200);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-500);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-badge-privacy {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
}

main {
    flex: 1;
    padding: 1.5rem 1rem 3rem 1rem;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin: 1.5rem auto 2.5rem auto;
}

.hero-pill {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--dark);
    margin-bottom: 0.8rem;
    line-height: 1.25;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.05rem;
    color: var(--gray-500);
    max-width: 680px;
    margin: 0 auto;
}

.app-container {
    max-width: 960px;
    margin: 0 auto;
}

.tab-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 1rem;
    scrollbar-width: thin;
}

.tab-btn {
    border: 1px solid var(--gray-200);
    background: #ffffff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.main-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    position: relative;
}

.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-icon-wrapper {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
}

.btn-upload {
    margin-top: 1.2rem;
    padding: 10px 24px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
}

.btn-upload:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.control-mode-selector {
    display: flex;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 10px;
    gap: 6px;
}

.mode-chip {
    border: none;
    background: transparent;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-chip.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.settings-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    background: var(--gray-50);
    padding: 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    margin-top: 1.2rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    display: flex;
    justify-content: space-between;
}

.setting-group input[type="text"],
.setting-group input[type="number"],
.setting-group select {
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    color: var(--dark);
    outline: none;
    font-family: inherit;
}

.setting-group input:focus,
.setting-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
}

.preset-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.preset-btn {
    border: 1px solid var(--gray-300);
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.queue-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    flex: 1;
}

.item-badge {
    padding: 4px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.75rem;
}

.item-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-size-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

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

.bulk-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 1.2rem;
    border-top: 1px solid var(--gray-200);
}

.stats-summary {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-700);
}

.btn-primary-action {
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-del {
    background: #fee2e2;
    color: var(--danger);
}

.btn-del:hover {
    background: #fecaca;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 960px;
    margin: 2.5rem auto 0 auto;
}

.feature-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 0.6rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 1.2rem;
}

.page-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.page-preview-box {
    height: 140px;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-500);
    overflow: hidden;
}

.page-ctrl-strip {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.camera-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.camera-video {
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    background: #000;
}

.scanned-pages-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
}

.scanned-thumb {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
}

footer {
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    padding: 1.8rem 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: auto;
}

.hidden {
    display: none !important;
}

/* Nonaktifkan sticky header pada mobile agar tidak menutupi layar saat scroll */
@media (max-width: 768px) {
    header {
        position: static !important;
        top: auto !important;
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.7rem;
    }
    .main-card {
        padding: 1.25rem;
    }
}


/* Toast Notification System */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90vw;
}
.toast-message {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.4;
}
.toast-info { background: #1e293b; }
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-message.fade-out {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    .toast-message {
        width: 100%;
        box-sizing: border-box;
    }
}


/* Brand Dino Logo WinRAR Style */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--dark);
    transition: transform 0.2s ease;
}
.brand:hover {
    transform: scale(1.02);
}
.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #a7f3d0;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}
.brand-dino-img {
    display: block;
    width: 34px;
    height: 34px;
}
.brand-highlight {
    color: var(--primary);
}

/* PDF CONVERTER UI STYLES */
.convert-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.format-card {
    background: #ffffff;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    user-select: none;
}

.format-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12);
}

.format-card.selected {
    border-color: var(--primary);
    background: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3), 0 8px 20px rgba(16, 185, 129, 0.15);
}

.format-card.selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 2px;
}

.format-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
}

.format-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.convert-preview-card {
    background: #ffffff;
    border: 1.5px solid var(--gray-200);
    border-radius: 14px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.convert-status-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 14px;
}

.convert-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #059669);
    width: 0%;
    transition: width 0.3s ease;
}
