:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #ec4899;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--secondary), #f43f5e);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    opacity: 0.3;
    animation-duration: 15s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -50px) scale(1.1);
    }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.logo i {
    color: var(--danger);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    margin-left: 2rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.view {
    display: none;
    flex: 1;
    padding: 3rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.4s ease-out forwards;
}

.view.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

.merge-icon {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.split-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.watermark-icon {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
}

.rotate-icon {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.jpg2pdf-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.pdf2jpg-icon {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.word-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.excel-icon {
    background: linear-gradient(135deg, #10b981, #047857);
}

.pdf2word-icon {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.pagenum-icon {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.delete-icon {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.tool-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--border);
    color: var(--text-main);
}

.tool-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.upload-area {
    border: 3px dashed var(--primary);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    background: var(--primary-light);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.upload-area.drag-over {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-hover);
    transform: scale(1.02);
}

.hidden-input {
    display: none;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.file-list-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.file-item {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
    flex: 1;
    position: relative;
    transition: transform 0.2s;
    user-select: none;
}

.file-item.draggable {
    cursor: grab;
}

.file-item.draggable:active {
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.file-item-icon {
    font-size: 2rem;
    color: var(--danger);
}

.file-item-info {
    flex: 1;
    overflow: hidden;
}

.file-item-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.file-item-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.remove-file {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.remove-file:hover {
    color: var(--danger);
}

.lang-switcher {
    margin-left: 20px;
}

#lang-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

#lang-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Panels */
.options-panel {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.input-group input[type="text"],
.input-group select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.input-group input[type="text"]:focus,
.input-group select:focus {
    border-color: var(--primary);
}

.info-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Organize Grid Stylings */
.organize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 10px;
}

.page-thumbnail {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    position: relative;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.page-thumbnail:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.page-thumbnail.unchecked {
    opacity: 0.5;
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.page-thumbnail.unchecked canvas {
    filter: grayscale(100%);
}

.page-thumbnail canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
    pointer-events: none;
    /* Prevents dragging issues */
    background: white;
}

.page-thumbnail-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 0 5px;
}

.page-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--danger);
}


.action-bar {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-action {
    background: #0f172a;
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

.btn-action:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-area {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 5rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-content {
    animation: fadeIn 0.5s ease-out;
}

.success-icon {
    font-size: 5rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.result-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.result-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--success);
    color: white;
    text-decoration: none;
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.23);
}

/* Utilities */
.mb-0 {
    margin-bottom: 0 !important;
}

.mt-3 {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .back-btn {
        position: static;
        transform: none;
        margin-bottom: 1rem;
        justify-content: center;
    }

    .tool-header h2 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }
}

/* PDFsHub Custom Premium Additions */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: overlayFadeIn 0.3s ease-out forwards;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loader-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

.loader-container p {
    margin-top: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.2px;
}

/* Compare Tool Styling */
#compare-result {
    border-left: 4px solid var(--primary) !important;
}

.diff-added-line {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border-left: 3px solid #22c55e;
}

.diff-removed-line {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-left: 3px solid #ef4444;
    text-decoration: line-through;
}

/* FAQ Section Styling */
.seo-faq-section {
    margin-top: 3rem;
    animation: fadeIn 0.6s ease-out;
}

.faq-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Live Preview styling */
#html-preview-box {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    border-color: var(--border);
    transition: all 0.3s ease;
}

/* Redact Tool Interactive Canvas */
.redact-pages-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.redact-page-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.redact-page-wrapper h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.redact-canvas-container {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
}

.redact-canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.redact-selection-overlay {
    position: absolute;
    background: rgba(0, 0, 0, 0.35);
    border: 2px dashed #ef4444;
    pointer-events: none;
    z-index: 5;
}

.redact-region {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ef4444;
    z-index: 4;
    cursor: default;
}

.redact-region-delete {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.15s;
}

.redact-region-delete:hover {
    transform: scale(1.2);
    background: #dc2626;
}

/* Edit items list */
.edit-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 4px;
}

.edit-item-tag button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
}

.edit-item-tag button:hover {
    color: var(--danger);
}

/* Number input styling */
.input-group input[type="number"] {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.input-group input[type="number"]:focus {
    border-color: var(--primary);
}