/* =============================================================
   Abold PDF Tools — Theme (Restored Classic Aesthetic)
   ============================================================= */

:root {
    --brand: #ef4444;
    --brand-hover: #dc2626;
    --accent: #b91c1c;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
}

/* Navigation Glass Effect */
.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .glass-nav {
    background: rgba(23, 23, 23, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Text Gradients */
.text-gradient {
    background: linear-gradient(to right, #f87171, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tool / Service Cards */
.service-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dark .service-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.15);
}

.dark .service-card:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.25);
}

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed #d1d5db;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

.dark .drop-zone {
    border-color: #374151;
    background-color: rgba(0, 0, 0, 0.2);
}

.drop-zone.dragover {
    border-color: #ef4444;
    background-color: #fef2f2;
    transform: scale(1.02);
}

.dark .drop-zone.dragover {
    background-color: rgba(239, 68, 68, 0.1);
}

.drop-zone.has-file {
    border-style: solid;
    border-color: #22c55e;
    background-color: #f0fdf4;
}

.dark .drop-zone.has-file {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

/* Draggable items */
.file-item, .page-item, .image-item {
    cursor: grab;
    transition: all 0.2s ease;
}

.file-item:active, .page-item:active, .image-item:active {
    cursor: grabbing;
}

.file-item.dragging, .page-item.dragging, .image-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    z-index: 50;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* --- SORTER PRO GRID & LIST VIEWS --- */
.page-container {
    transition: all 0.3s ease;
    min-height: 220px;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.grid-view .page-item {
    flex-direction: column;
    padding: 12px;
    align-items: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .grid-view .page-item {
    background-color: rgba(31, 41, 55, 0.5);
    border-color: #374151;
}

.grid-view .page-item:hover {
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
}

.grid-view .drag-handle { display: none; }

.grid-view .thumb-wrapper {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.dark .grid-view .thumb-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border-color: #1f2937;
}

.grid-view .thumb-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.grid-view .page-badge {
    font-size: 0.75rem;
    font-weight: 700;
    background: #111827;
    color: white;
    padding: 4px 12px;
    border-radius: 9999px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .grid-view .page-badge {
    background: #e5e7eb;
    color: #111827;
}

.grid-view .btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 8px -1px rgba(239, 68, 68, 0.5);
    z-index: 10;
    cursor: pointer;
    border: none;
}

.grid-view .page-item:hover .btn-remove {
    opacity: 1;
    transform: scale(1);
}

.grid-view .page-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    width: 100%;
    justify-content: center;
}

.grid-view .page-action-btn {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #6b7280;
    background: #f1f5f9;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}

.dark .grid-view .page-action-btn {
    background: #374151;
    color: #d1d5db;
}

.grid-view .page-action-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.dark .grid-view .page-action-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
}

/* --- LIST VIEW --- */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-view .page-item {
    flex-direction: row;
    align-items: center;
    padding: 12px 20px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.dark .list-view .page-item {
    background-color: rgba(31, 41, 55, 0.5);
    border-color: #374151;
}

.list-view .drag-handle {
    display: flex;
    color: #9ca3af;
    font-size: 1.25rem;
    margin-right: 16px;
    cursor: grab;
    transition: color 0.2s;
}

.list-view .page-item:hover .drag-handle { color: #6b7280; }
.dark .list-view .page-item:hover .drag-handle { color: #d1d5db; }

.list-view .thumb-wrapper {
    width: 55px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.dark .list-view .thumb-wrapper {
    background: rgba(0,0,0,0.5);
    border-color: #374151;
}

.list-view .thumb-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

.list-view .page-badge {
    flex-grow: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.list-view .page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.list-view .page-action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    background: #f1f5f9;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}

.dark .list-view .page-action-btn {
    background: #374151;
    color: #d1d5db;
}

.list-view .page-action-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.dark .list-view .page-action-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
}

.list-view .btn-remove {
    color: #ef4444;
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

.list-view .btn-remove:hover { 
    background-color: #fef2f2; 
}

.dark .list-view .btn-remove:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

/* Canvas generated by PDF.js */
canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

