/* ===========================
   DESIGN TOKENS & OVERRIDES
   =========================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --bg-primary: #0d0f14;
    --bg-card: #1a1e28;
    --bg-card-hover: #1f2435;
    --border-color: #252b3b;
    --border-dashed: #3b4460;
    --accent-blue: #4f8ef7;
    --gradient: linear-gradient(135deg, #4f8ef7, #a44ff7);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary) !important;
    -webkit-font-smoothing: antialiased;
}

body[data-theme="light"] {
    --bg-primary: #f4f6fb;
    --bg-card: #ffffff;
    --bg-card-hover: #edf1f8;
    --border-color: #d8deea;
    --border-dashed: #9aa8c1;
    color: #1d2738 !important;
    background-color: var(--bg-primary) !important;
}

body[data-theme="light"] .text-light { color: #1d2738 !important; }
body[data-theme="light"] .text-secondary,
body[data-theme="light"] .text-muted { color: #596579 !important; }
body[data-theme="light"] .bg-dark,
body[data-theme="light"] .dropzone { background-color: #fff !important; }
body[data-theme="light"] .bg-glass { background: rgba(244, 246, 251, 0.9) !important; }
body[data-theme="light"] .form-control,
body[data-theme="light"] .form-select { background-color: #fff !important; color: #1d2738 !important; }
body[data-theme="light"] .list-group-item-dark { background-color: #fff; color: #1d2738; }

.max-w-1200 { max-width: 1200px; }
.max-w-1000 { max-width: 1000px; }
.max-w-800  { max-width: 800px; }

/* ===========================
   NAVBAR
   =========================== */
.bg-glass {
    background: rgba(13, 15, 20, 0.85) !important;
    backdrop-filter: blur(16px);
}

.brand-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.35rem 0.7rem !important;
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: var(--bg-card);
    color: #fff !important;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   TOOL CARDS (home grid)
   =========================== */
.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-dashed);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Colour tokens */
.text-blue   { color: #4f8ef7; }
.bg-blue-subtle   { background: rgba(79, 142, 247, 0.15); }

.text-red    { color: #f76a4f; }
.bg-red-subtle    { background: rgba(247, 106, 79, 0.15); }

.text-purple { color: #a44ff7; }
.bg-purple-subtle { background: rgba(164, 79, 247, 0.15); }

.text-green  { color: #4fc8a4; }
.bg-green-subtle  { background: rgba(79, 200, 164, 0.15); }

.text-orange { color: #f7a44f; }
.bg-orange-subtle { background: rgba(247, 164, 79, 0.15); }

.text-cyan   { color: #4fd8f7; }
.bg-cyan-subtle   { background: rgba(79, 216, 247, 0.15); }

.text-pink   { color: #f74fa4; }
.bg-pink-subtle   { background: rgba(247, 79, 164, 0.15); }

.text-teal   { color: #2dd4bf; }
.bg-teal-subtle   { background: rgba(45, 212, 191, 0.15); }

.cta-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
}

/* ===========================
   SPA SECTION TRANSITIONS
   =========================== */
.section-active {
    display: block;
    animation: fadeIn 0.3s;
}

.section-hidden { display: none; }

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

/* ===========================
   GENERIC TOOL CARD
   =========================== */
.bg-card {
    background-color: var(--bg-card) !important;
}

/* ===========================
   DROPZONE
   =========================== */
.border-dashed {
    border: 2px dashed var(--border-dashed) !important;
}

.dropzone {
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.2);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-blue) !important;
    background: rgba(79, 142, 247, 0.06);
}

/* ===========================
   FILE LIST
   =========================== */
.list-group-item-dark {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: #fff;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-gradient {
    background: var(--gradient);
    color: white;
    border: none;
}

.btn-gradient:hover:not(:disabled) {
    color: white;
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(79, 142, 247, 0.4);
}

.bg-gradient {
    background: var(--gradient) !important;
}

/* ===========================
   QUALITY SLIDER
   =========================== */
.quality-slider {
    accent-color: #4fd8f7;
    cursor: pointer;
}

/* ===========================
   PDF PAGE ARRANGER
   =========================== */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    padding: 8px 0 24px;
}

.page-thumb {
    cursor: grab;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
    user-select: none;
}

.page-thumb:hover {
    border-color: #4f8ef7;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.page-thumb.dragging {
    opacity: 0.45;
    cursor: grabbing;
    transform: scale(0.97);
}

.page-thumb.drag-over {
    border-color: #a44ff7;
    box-shadow: 0 0 0 3px rgba(164, 79, 247, 0.35);
}

.page-thumb-inner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.page-thumb-inner img {
    width: 100%;
    display: block;
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.page-label {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 4px;
    color: #ccc;
    background: rgba(0,0,0,0.3);
    border-radius: 0 0 8px 8px;
}

.page-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(247, 79, 79, 0.85);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    color: #fff;
    padding: 0;
}

.page-thumb:hover .page-delete-btn {
    opacity: 1;
}

/* Spinner colour for pink theme */
.spinner-border.text-pink {
    color: #f74fa4 !important;
}

/* ===========================
   IMAGE RESIZER SECTION
   =========================== */
.btn-teal-gradient {
    background: linear-gradient(135deg, #2dd4bf, #0891b2);
    color: #fff;
    border: none;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.btn-teal-gradient:hover:not(:disabled) {
    color: #fff;
    opacity: 0.9;
    box-shadow: 0 4px 16px rgba(45, 212, 191, 0.4);
}

.resize-tabs .nav-link {
    color: #9ca3af;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.resize-tabs .nav-link.active {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
    border-color: #2dd4bf;
}

.resize-pct-slider {
    accent-color: #2dd4bf;
    cursor: pointer;
}
