/* ===================================================================
   Toolbox Online — Custom Theme (Bootstrap 5.3 compatible)
   =================================================================== */

:root {
    --tb-primary: #2563eb;
    --tb-primary-dark: #1d4ed8;
    --tb-primary-light: #3b82f6;
    --tb-accent: #7c3aed;
    --tb-success: #10b981;
    --tb-bg-soft: #f0f4ff;
    --tb-text: #1e293b;
    --tb-radius: 10px;
    --tb-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --tb-shadow-hover: 0 8px 30px rgba(37,99,235,0.15);
}

/* ===== BASE ===== */
html { font-size: 14px; scroll-behavior: smooth; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--tb-text);
    background: #f8fafc;
}

main.flex-grow-1 { flex: 1; }

/* ===== NAVBAR ===== */
header .navbar {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 60%, #7c3aed 100%) !important;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: none;
}
header .navbar-brand { font-size: 1.25rem; letter-spacing: -0.3px; }
header .navbar-brand i {
    background: rgba(255,255,255,0.18);
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 1.1rem;
}
header .navbar .nav-link { font-weight: 500; }
header .navbar .form-control { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: #fff; }
header .navbar .form-control::placeholder { color: rgba(255,255,255,0.65); }
header .navbar .form-control:focus { background: #fff; color: var(--tb-text); border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.3); }

/* ===== HERO ===== */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #6d28d9 100%) !important;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -40%; right: -15%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-section .container { position: relative; z-index: 1; }
.hero-section h1 { text-shadow: 0 2px 10px rgba(0,0,0,0.15); }

/* ===== CARD HOVER (tool/category cards) ===== */
.card-hover {
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: var(--tb-radius);
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--tb-shadow-hover);
}
.card-hover:focus-visible {
    outline: 2px solid var(--tb-primary);
    outline-offset: 2px;
}
.card-hover .card-body i.fs-2,
.card-hover .card-body i.fs-4 {
    color: var(--tb-primary);
}

/* ===== TOOL CARD ===== */
#toolCard {
    border: none;
    border-radius: 14px;
    box-shadow: var(--tb-shadow);
    overflow: hidden;
}
#toolCard::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--tb-primary), var(--tb-accent));
}
#toolCard .card-body { padding: 1.5rem; }

/* ===== BUTTONS ===== */
.tool-form .btn-primary,
#toolCard .btn-primary {
    background: linear-gradient(135deg, var(--tb-primary) 0%, var(--tb-accent) 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}
.tool-form .btn-primary:hover,
#toolCard .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.btn-success { border-radius: 8px; font-weight: 600; }

/* ===== FORMS ===== */
.tool-form .form-control,
.tool-form .form-select {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    padding: 0.55rem 0.85rem;
}
.tool-form .form-control:focus,
.tool-form .form-select:focus {
    border-color: var(--tb-primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.tool-form .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.3rem;
}
.form-check-input:checked {
    background-color: var(--tb-primary);
    border-color: var(--tb-primary);
}

/* ===== BREADCRUMB ===== */
.breadcrumb-item a {
    text-decoration: none;
    color: var(--tb-primary);
    font-weight: 500;
}
.breadcrumb-item a:hover { text-decoration: underline; }

/* ===== BADGE ===== */
.bg-primary-subtle {
    background-color: #dbeafe !important;
    color: var(--tb-primary) !important;
    font-weight: 600;
}

/* ===== ACCORDION (FAQ) ===== */
.accordion-item {
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: var(--tb-radius) !important;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.accordion-button { font-weight: 600; font-size: 0.95rem; }
.accordion-button:not(.collapsed) {
    background: var(--tb-bg-soft);
    color: var(--tb-primary);
    box-shadow: none;
}
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* ===== SECTIONS ===== */
section h2 i { color: var(--tb-primary); }
.text-primary { color: var(--tb-primary) !important; }

/* ===== AD SLOT ===== */
.ad-slot {
    min-height: 90px;
    background: #f8fafc;
    border: 1px dashed #d1d5db !important;
    border-radius: var(--tb-radius);
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-results {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: none;
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    margin-top: 4px;
}
.autocomplete-results .autocomplete-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    color: var(--tb-text);
    font-weight: 500;
}
.autocomplete-results .autocomplete-item:hover { background: #f1f5f9; }
.autocomplete-results .autocomplete-item i { color: var(--tb-primary); margin-right: 0.5rem; }

/* ===== FOOTER ===== */
footer.bg-dark {
    background: linear-gradient(180deg, #111827 0%, #1e293b 100%) !important;
}
footer h5, footer h6 { color: #f1f5f9; }
footer a:hover { color: #93c5fd !important; }
footer .text-secondary { color: #94a3b8 !important; }
footer hr.border-secondary { border-color: #374151 !important; }

/* ===== ALERTS ===== */
.alert { border-radius: var(--tb-radius); }

/* ===== FILE UPLOAD ZONE ===== */
.file-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--tb-radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafbfc;
}
.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--tb-primary);
    background: var(--tb-bg-soft);
}
.file-upload-zone i.bi-cloud-arrow-up {
    font-size: 2.5rem;
    color: var(--tb-primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== PDF PREVIEW ===== */
.pdf-preview-frame {
    border: 2px solid #e2e8f0;
    border-radius: var(--tb-radius);
    min-height: 500px;
    background: #f8fafc;
}

/* ===== CV STYLE SELECTOR ===== */
.cv-preview-container {
    background: var(--tb-bg-soft);
    border-radius: 14px;
    padding: 1.25rem;
}
.cv-style-option {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: var(--tb-radius);
    padding: 0.65rem 0.5rem;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
}
.cv-style-option:hover,
.cv-style-option.active {
    border-color: var(--tb-primary);
    background: var(--tb-bg-soft);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.cv-style-option i { font-size: 1.4rem; display: block; margin-bottom: 0.2rem; }

/* ===== MONOSPACE ===== */
.font-monospace { letter-spacing: 0.3px; }

/* ===== FOCUS RING ===== */
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,0.25); }

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .hero-section h1 { font-size: 1.6rem; }
    .hero-section .lead { font-size: 0.95rem; }
    #toolCard .card-body { padding: 1rem !important; }
    .file-upload-zone { padding: 1.25rem 0.75rem; }
    .cv-style-option { padding: 0.5rem 0.25rem; }
    .cv-style-option i { font-size: 1.1rem; }
}

/* ===== FORM FLOATING (Bootstrap override fix) ===== */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}
