/* =============================================================
   WebTools — base.css
   Brand colours: #6366f1 (indigo) → #764ba2 (purple)
   ============================================================= */

/* ---------------------------------------------------------------
   CSS CUSTOM PROPERTIES
   --------------------------------------------------------------- */
:root {
    --wt-primary:       #6366f1;
    --wt-primary-dark:  #4f46e5;
    --wt-secondary:     #764ba2;
    --wt-gradient:      linear-gradient(135deg, #6366f1 0%, #764ba2 100%);
    --wt-gradient-hero: linear-gradient(135deg, #4f46e5 0%, #764ba2 50%, #9333ea 100%);

    --wt-body-bg:       #f8f9ff;
    --wt-card-bg:       #ffffff;
    --wt-card-border:   rgba(99,102,241,.12);
    --wt-text:          #1e1e2e;
    --wt-text-muted:    #6c757d;
    --wt-navbar-bg:     linear-gradient(90deg, #4f46e5 0%, #764ba2 100%);
    --wt-footer-bg:     #1e1e2e;
    --wt-footer-text:   #adb5bd;

    --wt-shadow-sm:     0 2px 8px rgba(99,102,241,.10);
    --wt-shadow-md:     0 6px 24px rgba(99,102,241,.18);
    --wt-shadow-lg:     0 12px 40px rgba(99,102,241,.22);

    --wt-radius:        .75rem;
    --wt-radius-sm:     .5rem;
    --wt-radius-lg:     1.25rem;

    --wt-transition:    all .22s ease;
}

/* Dark theme overrides */
[data-bs-theme="dark"] {
    --wt-body-bg:    #12121f;
    --wt-card-bg:    #1e1e30;
    --wt-card-border:rgba(99,102,241,.20);
    --wt-text:       #e2e2f0;
    --wt-text-muted: #9b9bb8;
    --wt-footer-bg:  #0d0d1a;
}

/* ---------------------------------------------------------------
   GLOBAL RESET & BASE
   --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--wt-body-bg);
    color: var(--wt-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color .3s ease, color .3s ease;
}

main#mainContent { flex: 1 0 auto; }

a { color: var(--wt-primary); text-decoration: none; }
a:hover { color: var(--wt-primary-dark); text-decoration: underline; }

/* ---------------------------------------------------------------
   ACCENT COLOUR UTILITY
   --------------------------------------------------------------- */
.wt-accent { color: var(--wt-primary); }

/* ---------------------------------------------------------------
   NAVBAR
   --------------------------------------------------------------- */
.wt-navbar {
    background: var(--wt-navbar-bg) !important;
    box-shadow: 0 2px 16px rgba(79,70,229,.30);
    padding-top: .6rem;
    padding-bottom: .6rem;
}

.wt-brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #fff !important;
    text-shadow: 0 1px 4px rgba(0,0,0,.25);
    transition: var(--wt-transition);
}
.wt-brand:hover { opacity: .88; text-decoration: none; }

.wt-navbar .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-weight: 500;
    border-radius: var(--wt-radius-sm);
    padding: .4rem .75rem !important;
    transition: var(--wt-transition);
}
.wt-navbar .nav-link:hover,
.wt-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.15);
}

/* Dropdowns */
.wt-dropdown {
    border: none;
    border-radius: var(--wt-radius);
    box-shadow: var(--wt-shadow-md);
    background: var(--wt-card-bg);
    overflow: hidden;
    min-width: 200px;
}
.wt-dropdown .dropdown-item {
    color: var(--wt-text);
    padding: .55rem 1.1rem;
    font-size: .92rem;
    transition: var(--wt-transition);
}
.wt-dropdown .dropdown-item:hover {
    background: linear-gradient(90deg, rgba(99,102,241,.10) 0%, transparent 100%);
    color: var(--wt-primary);
}

/* Dark/Light toggle button */
.wt-theme-btn {
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wt-transition);
}
.wt-theme-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.40);
}

/* ---------------------------------------------------------------
   HERO SECTION
   --------------------------------------------------------------- */
.wt-hero {
    background: var(--wt-gradient-hero);
    position: relative;
    overflow: hidden;
    padding-top: 5rem;
    padding-bottom: 2rem;
}

.wt-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(255,255,255,.07) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 80% 30%, rgba(255,255,255,.05) 0%, transparent 60%);
    pointer-events: none;
}

.wt-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255,255,255,.25);
}

.wt-hero .display-4 { text-shadow: 0 2px 12px rgba(0,0,0,.20); }

.wt-hero-btn {
    border-radius: 3rem;
    padding: .65rem 1.8rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    transition: var(--wt-transition);
}
.wt-hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,.22);
}

.opacity-90 { opacity: .90; }
.opacity-75 { opacity: .75; }

/* Hero wave divider */
.wt-hero-wave {
    line-height: 0;
    margin-top: 3rem;
}
.wt-hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ---------------------------------------------------------------
   CATEGORY FILTER TABS
   --------------------------------------------------------------- */
.wt-filter-tabs {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    background: var(--wt-card-bg);
    padding: .35rem;
    border-radius: 3rem;
    box-shadow: var(--wt-shadow-sm);
    border: 1px solid var(--wt-card-border);
}

.wt-filter-btn {
    border: none;
    background: transparent;
    color: var(--wt-text-muted);
    font-size: .85rem;
    font-weight: 600;
    padding: .4rem 1rem;
    border-radius: 3rem;
    cursor: pointer;
    transition: var(--wt-transition);
    white-space: nowrap;
}
.wt-filter-btn:hover {
    color: var(--wt-primary);
    background: rgba(99,102,241,.08);
}
.wt-filter-btn.active {
    background: var(--wt-gradient);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,.35);
}

/* ---------------------------------------------------------------
   CATEGORY SECTION HEADERS
   --------------------------------------------------------------- */
.wt-cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--wt-radius-sm);
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}
.wt-cat-seo     { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.wt-cat-image   { background: linear-gradient(135deg, #ec4899, #9333ea); }
.wt-cat-web     { background: linear-gradient(135deg, #06b6d4, #3b82f6); }

.wt-count-badge {
    background: rgba(99,102,241,.12);
    color: var(--wt-primary);
    font-size: .72rem;
    font-weight: 700;
    border-radius: 3rem;
    padding: .2em .65em;
}

/* ---------------------------------------------------------------
   TOOL CARDS
   --------------------------------------------------------------- */
.wt-tool-card {
    background: var(--wt-card-bg);
    border-radius: var(--wt-radius) !important;
    border: 1px solid var(--wt-card-border) !important;
    box-shadow: var(--wt-shadow-sm) !important;
    transition: var(--wt-transition);
    position: relative;
    overflow: hidden;
}
.wt-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--wt-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}
.wt-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--wt-shadow-md) !important;
    border-color: rgba(99,102,241,.30) !important;
}
.wt-tool-card:hover::before { transform: scaleX(1); }

.wt-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: rgba(99,102,241,.10);
    border-radius: var(--wt-radius-sm);
    color: var(--wt-primary);
    transition: var(--wt-transition);
}
.wt-tool-card:hover .wt-tool-icon {
    background: var(--wt-gradient);
    color: #fff;
    transform: scale(1.05);
}

/* Hidden card when filter is applied */
.wt-tool-card-wrap.wt-hidden {
    display: none !important;
}

/* Empty state */
.wt-empty-state { color: var(--wt-text-muted); }

/* ---------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------- */
.wt-btn-primary {
    background: var(--wt-gradient);
    color: #fff !important;
    border: none;
    border-radius: var(--wt-radius-sm);
    font-weight: 600;
    letter-spacing: .02em;
    transition: var(--wt-transition);
    box-shadow: 0 2px 8px rgba(99,102,241,.30);
}
.wt-btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99,102,241,.40);
    color: #fff !important;
}
.wt-btn-primary:active { transform: none; filter: brightness(.96); }

/* ---------------------------------------------------------------
   FEATURES STRIP
   --------------------------------------------------------------- */
.wt-features-strip {
    background: var(--wt-card-bg);
    border-top: 1px solid var(--wt-card-border);
    border-bottom: 1px solid var(--wt-card-border);
}

.wt-feature-item {
    border-radius: var(--wt-radius);
    transition: var(--wt-transition);
}
.wt-feature-item:hover {
    background: rgba(99,102,241,.05);
}

/* ---------------------------------------------------------------
   TOOL PAGE LAYOUT (shared across individual tools)
   --------------------------------------------------------------- */
.wt-tool-page {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

.wt-tool-header {
    padding: 1.75rem 2rem;
    background: var(--wt-gradient);
    border-radius: var(--wt-radius-lg);
    color: #fff;
    margin-bottom: 2rem;
    box-shadow: var(--wt-shadow-md);
}
.wt-tool-header .wt-tool-icon {
    background: rgba(255,255,255,.18);
    color: #fff;
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
}

.wt-tool-panel {
    background: var(--wt-card-bg);
    border-radius: var(--wt-radius);
    padding: 2rem;
    box-shadow: var(--wt-shadow-sm);
    border: 1px solid var(--wt-card-border);
}

/* ---------------------------------------------------------------
   FORMS
   --------------------------------------------------------------- */
.form-control,
.form-select {
    background-color: var(--wt-body-bg);
    border: 1.5px solid var(--wt-card-border);
    border-radius: var(--wt-radius-sm);
    color: var(--wt-text);
    transition: var(--wt-transition);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--wt-card-bg);
    border-color: var(--wt-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    color: var(--wt-text);
}

/* File Upload Drop Zone */
.wt-dropzone {
    border: 2px dashed var(--wt-primary);
    border-radius: var(--wt-radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--wt-transition);
    background: rgba(99,102,241,.03);
}
.wt-dropzone:hover,
.wt-dropzone.dragover {
    background: rgba(99,102,241,.08);
    border-color: var(--wt-primary-dark);
}
.wt-dropzone-icon { color: var(--wt-primary); margin-bottom: .75rem; }

/* Image Preview */
.wt-image-preview {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--wt-radius-sm);
    border: 1px solid var(--wt-card-border);
    box-shadow: var(--wt-shadow-sm);
}

/* ---------------------------------------------------------------
   LOADING SPINNER OVERLAY
   --------------------------------------------------------------- */
.wt-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,15,30,.72);
    z-index: 9999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.wt-loading-overlay.d-none { display: none !important; }

.wt-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp .25s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------
   TOAST NOTIFICATIONS
   --------------------------------------------------------------- */
.toast {
    border-radius: var(--wt-radius-sm);
    box-shadow: var(--wt-shadow-md);
    min-width: 280px;
}
.toast-header { font-weight: 600; }

/* ---------------------------------------------------------------
   "TOOL DISABLED" PAGE
   --------------------------------------------------------------- */
.wt-disabled-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,193,7,.12);
}

/* ---------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------- */
.wt-footer {
    background: var(--wt-footer-bg);
    color: var(--wt-footer-text);
    flex-shrink: 0;
}
.wt-footer-brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.3px;
}
.wt-footer a {
    color: var(--wt-footer-text);
    transition: color .2s;
}
.wt-footer a:hover { color: #fff; }

/* ---------------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   --------------------------------------------------------------- */
@media (max-width: 576px) {
    .wt-hero { padding-top: 3.5rem; }
    .wt-hero .display-4 { font-size: 2rem; }
    .wt-filter-tabs { gap: .25rem; }
    .wt-filter-btn { font-size: .78rem; padding: .35rem .75rem; }
    .wt-tool-panel { padding: 1.25rem; }
    .wt-tool-header { padding: 1.25rem; }
}

@media (max-width: 768px) {
    .wt-hero { padding-top: 4rem; }
}

/* ---------------------------------------------------------------
   SCROLLBAR (Webkit)
   --------------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--wt-body-bg); }
::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,.35);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--wt-primary); }

/* ---------------------------------------------------------------
   UTILITY — smooth section reveal
   --------------------------------------------------------------- */
.wt-category-section {
    scroll-margin-top: 80px; /* offset for sticky nav */
}
