/* --- GLOBAL BACKGROUND --- */
body {
    background: #f8fafd; /* Very light blue-gray */
}

/* --- THEME TOGGLE BUTTON (floating, fixed top-right) --- */
.theme-toggle-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1050;
    background: var(--bs-body-bg, #fff); /* Uses Bootstrap var if set, else white */
    border: none;
    border-radius: 50%;
    padding: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: background 0.2s;
}
.theme-toggle-btn:focus {
    outline: 2px solid #0d6efd; /* Accessible focus indicator */
}

/* --- SUBTLE DOT/HEX PATTERN BACKGROUND --- */
/* This goes *under* all UI content, for visual texture */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: .08;
    /* SVG background: one blue dot per 40px square */
    background: url('data:image/svg+xml;utf8,<svg fill="none" height="40" width="40" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="1.5" fill="%23069" /></svg>');
    pointer-events: none; /* Don't block UI events */
}

/* --- WHITE CARD/ELEMENT BACKGROUNDS (SOLID) --- */
/* Use for .card, etc to block dot bg underneath */
.card,
.bg-white,
.imgmizer-solid {
    background: #fff !important;
    border-radius: 1rem;
    border: 1px solid #e5e8f3;
}

/* --- BUTTON GROUP BAR (eg. Compression Level) --- */
.imgmizer-btnbar {
    background: #fff !important;
    border-radius: 0.7rem;
    box-shadow: 0 1px 5px 0 rgba(30,40,100,.05);
    border: 1px solid #e5e8f3;
    padding: .25rem .5rem;
    margin-bottom: 1.5rem;
}

/* --- BUTTON GROUP BUTTONS: REMOVE DEFAULTS ON INACTIVE --- */
.imgmizer-btnbar .btn,
.imgmizer-btnbar .btn-outline-primary {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* --- BUTTON GROUP BUTTONS: ACTIVE STATE --- */
.imgmizer-btnbar .btn.active,
.imgmizer-btnbar .btn:active {
    background: #1463ff !important;
    color: #fff !important;
    box-shadow: 0 1px 8px 0 rgba(20,99,255,.07);
}

/* --- DROPZONE AREA --- */
.dropzone {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #c5ccd8 !important;
    border-radius: 16px !important;
    background: #fff !important;
    transition: border-color .2s, background .2s, box-shadow .2s;
    padding: 2.5rem 1.5rem;
    cursor: pointer;
    position: relative;
}
.dropzone.dz-drag-hover,
.dropzone:focus-within {
    border-color: #4361ee !important;
    background: #f3f5ff !important;
    box-shadow: 0 0 0 4px rgba(67,97,238,.08);
}

/* Picflow-style message */
.dz-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
}
.dz-upload-icon {
    margin-bottom: 0.5rem;
    line-height: 0;
}
.dz-main-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a2340;
    letter-spacing: -.01em;
}
.dz-sub-label {
    font-size: 0.92rem;
    color: #6b7280;
}
.dz-browse-link {
    color: #4361ee;
    cursor: pointer;
    pointer-events: all;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dz-limits-label {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Hide Dropzone's own preview thumbnails — results render in #resultArea */
.dropzone .dz-preview {
    display: none !important;
}

/* --- RESULT CARDS --- */
#resultArea {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e5e8f3;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(30,40,100,.05);
    animation: result-fadein 0.25s ease;
}
@keyframes result-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.result-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f0f0f0;
}
.result-info {
    flex: 1;
    min-width: 0;
}
.result-filename {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a2340;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}
.result-sizes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.84rem;
    color: #6b7280;
    margin-bottom: 0.4rem;
}
.result-sizes .size-orig {
    text-decoration: line-through;
    opacity: .7;
}
.result-sizes .size-arrow {
    color: #9ca3af;
    font-size: 0.75rem;
}
.result-sizes .size-opt {
    font-weight: 600;
    color: #1a2340;
}
.badge-saved {
    background: #dcfce7;
    color: #16a34a;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.result-webp-line {
    font-size: 0.8rem;
    color: #7c3aed;
    margin-bottom: 0.5rem;
}
.result-webp-line strong { font-weight: 600; }
.result-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.btn-dl {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
}
.btn-dl:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn-dl-jpg  { background: #4361ee; color: #fff; }
.btn-dl-webp { background: #7c3aed; color: #fff; }

@media (max-width: 500px) {
    .result-card { flex-direction: column; align-items: flex-start; }
    .result-thumb { width: 100%; height: 160px; }
}

/* --- CIRCLE ICON BACKGROUND (Hero, etc) --- */
.imgmizer-icon-bg {
    background: #eaf0ff !important;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: .75rem;
}

.services-box {
    border: 2px dashed #f0f2f5;
    border-radius: 1rem;
    padding: 30px;
    background: #fff; /* Or your desired background */
}

/* --- INFO CARD TWEAK (How it Works/Security) --- */
.imgmizer-info-card {
    background: #fff !important;
    border: 1px solid #e5e8f3;
    border-radius: 1rem;
    box-shadow: 0 2px 10px 0 rgba(60,80,130,.05);
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
}

/* --- MOBILE/RESPONSIVE TWEAKS --- */
@media (max-width: 767px) {
    .imgmizer-info-card,
    .dropzone,
    .card {
        border-radius: 0.7rem;
        padding: 1rem !important;
    }
}

/* ============================================================
   HERO
   ============================================================ */
.hero-badge-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.hero-badge {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #eef0fb;
    color: #4361ee;
    letter-spacing: .02em;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.03em;
    color: #0f172a;
    margin-bottom: .75rem;
}
.hero-title-accent { color: #4361ee; }
.hero-sub {
    font-size: 1.05rem;
    color: #64748b;
    max-width: 480px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}
.hero-cta {
    font-weight: 700;
    font-size: 1rem;
    padding: .75rem 2.5rem;
    display: inline-flex;
    align-items: center;
}

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
    .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
    .features-grid { grid-template-columns: 1fr; }
}
.feature-card {
    background: #fff;
    border: 1px solid #e5e8f3;
    border-radius: 14px;
    padding: 1.25rem;
    transition: box-shadow .18s, transform .18s;
    position: relative;
    overflow: hidden;
}
.feature-card:hover {
    box-shadow: 0 6px 24px rgba(67,97,238,.1);
    transform: translateY(-2px);
}
.feature-icon {
    /* Ghost: large, low-alpha, top-right corner */
    position: absolute;
    top: -10px;
    right: -10px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fc);
    opacity: .10;
    pointer-events: none;
}
.feature-icon svg {
    width: 64px;
    height: 64px;
}
.feature-title {
    font-size: .9rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: .3rem;
}
.feature-desc {
    font-size: .82rem;
    color: #64748b;
    line-height: 1.55;
}

/* ============================================================
   PROMO BANNER
   ============================================================ */
.promo-banner {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: .9rem 1.25rem;
    font-size: .88rem;
    color: #78350f;
}
.promo-icon {
    color: #d97706;
    flex-shrink: 0;
    line-height: 0;
}
.promo-text a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.promo-text a:hover { color: #78350f; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    border-top: 1px solid #e5e8f3;
    padding: 1.5rem 0;
    margin-top: 2rem;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem 2rem;
    text-align: center;
}
.footer-brand {
    font-weight: 600;
    font-size: .9rem;
    color: #374151;
    display: flex;
    align-items: center;
}
.footer-legal {
    font-size: .8rem;
    color: #9ca3af;
}
.footer-credit {
    font-size: .8rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
}
.footer-credit a {
    color: #4361ee;
    text-decoration: none;
    font-weight: 600;
}
.footer-credit a:hover { text-decoration: underline; }

/* --- DARK MODE SUPPORT --- */
[data-bs-theme="dark"] body { background: #1a2330; }
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .imgmizer-solid {
    background: #20293b !important;
    color: #e8ecf4;
    border-color: #2e3951 !important;
    box-shadow: 0 2px 16px 0 rgba(0,0,0,.10), 0 1.5px 4px 0 rgba(0,0,0,.04);
}
[data-bs-theme="dark"] .dropzone {
    background: #1e2a3a !important;
    border-color: #2e3d56 !important;
}
[data-bs-theme="dark"] .dropzone.dz-drag-hover,
[data-bs-theme="dark"] .dropzone:focus-within {
    background: #1a2540 !important;
    border-color: #4361ee !important;
}
[data-bs-theme="dark"] .dz-main-label { color: #e8ecf4; }
[data-bs-theme="dark"] .dz-sub-label  { color: #8a94a8; }
[data-bs-theme="dark"] .dz-limits-label { color: #5a6478; }
[data-bs-theme="dark"] .dz-upload-icon svg rect[fill="white"] { fill: #20293b; }
[data-bs-theme="dark"] .dz-upload-icon svg rect[stroke="#dde3f4"] { stroke: #2e3951; }
[data-bs-theme="dark"] .result-card {
    background: #20293b;
    border-color: #2e3951;
}
[data-bs-theme="dark"] .result-filename { color: #e8ecf4; }
[data-bs-theme="dark"] .result-sizes .size-opt { color: #c8d0e8; }
[data-bs-theme="dark"] .badge-saved { background: #14532d; color: #4ade80; }
[data-bs-theme="dark"] .result-webp-line { color: #a78bfa; }

/* Dark mode — hero */
[data-bs-theme="dark"] .hero-title { color: #f1f5f9; }
[data-bs-theme="dark"] .hero-sub   { color: #94a3b8; }
[data-bs-theme="dark"] .hero-badge { background: #1e2a3a; color: #7b9ef8; }

/* Dark mode — features */
[data-bs-theme="dark"] .feature-card {
    background: #1e2a3a;
    border-color: #2e3951;
}
[data-bs-theme="dark"] .feature-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.3); }
[data-bs-theme="dark"] .feature-title { color: #e2e8f0; }
[data-bs-theme="dark"] .feature-desc  { color: #8a94a8; }

/* Dark mode — promo */
[data-bs-theme="dark"] .promo-banner {
    background: #1c1a0e;
    border-color: #4a3800;
    color: #fbbf24;
}
[data-bs-theme="dark"] .promo-text a { color: #fbbf24; }
[data-bs-theme="dark"] .promo-icon   { color: #fbbf24; }

/* Dark mode — footer */
[data-bs-theme="dark"] .site-footer { border-color: #2e3951; }
[data-bs-theme="dark"] .footer-brand { color: #c8d0e8; }
[data-bs-theme="dark"] .footer-legal { color: #4a5568; }
[data-bs-theme="dark"] .footer-credit { color: #4a5568; }
[data-bs-theme="dark"] .imgmizer-btnbar {
    background: #212f4d !important;
    border-color: #2e3951 !important;
}
[data-bs-theme="dark"] .btn-outline-primary {
    color: #b3ccff;
    border-color: #3777ff;
}
[data-bs-theme="dark"] .btn-outline-primary.active,
[data-bs-theme="dark"] .btn-outline-primary:active,
[data-bs-theme="dark"] .btn-outline-primary:focus {
    background: #3777ff !important;
    color: #fff !important;
}
[data-bs-theme="dark"] .theme-toggle-btn {
    background: #222f40;
    color: #fff;
}
[data-bs-theme="dark"] .imgmizer-icon-bg {
    background: #162034 !important;
}
[data-bs-theme="dark"] body::before {
    opacity: .14; /* dots a bit brighter in dark mode */
}
[data-bs-theme="dark"] .text-primary {
    color: #87aaff !important;
}
[data-bs-theme="dark"] .bg-white {
    background: #20293b !important;
}

