/* =========================================================
   Cookie consent bar
   ========================================================= */

.cookie-alert {
    position: fixed;
    bottom: 0;
    left: 0;

    width: 100%;
    z-index: 9999;

    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));

    background: rgba(255, 255, 255, 0.96);
    color: #24232d;

    border-top: 1px solid rgba(76, 63, 242, 0.12);

    box-shadow:
        0 -10px 35px rgba(30, 28, 50, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.cookie-alert-inner {
    width: min(1180px, 100%);
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 14px;
}

.cookie-alert-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: rgba(76, 63, 242, 0.09);
    color: var(--color-primary);

    font-size: 17px;
}

.cookie-alert-message {
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;

    color: #555260;
}

.cookie-alert-button {
    appearance: none;
    border: 0;

    min-height: 40px;

    padding: 9px 18px;

    border-radius: 10px;

    background: var(--color-primary);
    color: #ffffff;

    font-size: 14px;
    font-weight: 500;

    white-space: nowrap;

    box-shadow:
        0 5px 14px rgba(76, 63, 242, 0.22);

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.cookie-alert-button:hover {
    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(76, 63, 242, 0.3);
}

.cookie-alert-button:focus-visible {
    outline: 3px solid rgba(76, 63, 242, 0.25);
    outline-offset: 3px;
}


/* =========================================================
   Dark theme
   ========================================================= */

body.dark .cookie-alert {
    background: rgba(27, 26, 37, 0.96);
    color: #ffffff;

    border-top-color: rgba(255, 255, 255, 0.08);

    box-shadow:
        0 -10px 35px rgba(0, 0, 0, 0.26);
}

body.dark .cookie-alert-icon {
    background: rgba(108, 94, 255, 0.14);
    color: #a9a1ff;
}

body.dark .cookie-alert-message {
    color: #d1cedb;
}

body.dark .cookie-alert-button {
    background: var(--color-primary);
    color: #ffffff;

    box-shadow:
        0 5px 16px rgba(76, 63, 242, 0.28);
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .cookie-alert {
        padding:
            13px
            15px
            calc(13px + env(safe-area-inset-bottom));
    }

    .cookie-alert-inner {
        justify-content: flex-start;
        gap: 11px;
    }

    .cookie-alert-icon {
        display: none;
    }

    .cookie-alert-message {
        flex: 1;

        font-size: 13px;
        line-height: 1.45;
    }

    .cookie-alert-button {
        min-height: 38px;

        padding: 8px 14px;

        font-size: 13px;
        border-radius: 9px;
    }
}

/* ── Homepage: Category header on TOP, 4 tools per row ── */

/* Stack category title above tools (override the default side-by-side flex) */
.content-sec .content-sec-inner {
  flex-direction: column !important;
}

/* Make category title full-width and horizontal (icon + text inline) */
.content-sec .content-sec-inner .content-title-sec {
  width: 100% !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-bottom: 28px !important;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(76, 63, 242, 0.12);
}

.content-sec .content-sec-inner .content-title-sec .content-title-icon {
  margin-bottom: 0 !important;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Make tool grid full-width */
.content-sec .content-sec-inner .content-cats-sec {
  width: 100% !important;
  flex: unset !important;
}

/* 4 columns on desktop */
.content-sec .content-sec-inner .content-cats-sec .content-cats-col {
  flex: 0 0 25% !important;
  width: 25% !important;
}

/* 3 columns on tablet-wide (≤1200px) */
@media (max-width: 1200px) {
  .content-sec .content-sec-inner .content-cats-sec .content-cats-col {
    flex: 0 0 33.333% !important;
    width: 33.333% !important;
  }
}

/* 2 columns on tablet (≤768px) */
@media (max-width: 768px) {
  .content-sec .content-sec-inner .content-cats-sec .content-cats-col {
    flex: 0 0 50% !important;
    width: 50% !important;
  }
}

/* 1 column on phone (≤480px) */
@media (max-width: 480px) {
  .content-sec .content-sec-inner .content-cats-sec .content-cats-col {
    flex: 0 0 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }
}

/* ── Dark Mode Tool Icon Fixes ── */

/* Force white stroke if present on the SVG or any child element */
.dark .content-cats-icon svg[stroke]:not([stroke="none"]),
.dark .content-cats-icon svg[stroke]:not([stroke="none"]) *,
.dark .content-cats-icon svg [stroke]:not([stroke="none"]),
.dark .single-page-icon svg[stroke]:not([stroke="none"]),
.dark .single-page-icon svg[stroke]:not([stroke="none"]) *,
.dark .single-page-icon svg [stroke]:not([stroke="none"]),
.dark .unlock-icon-wrapper svg[stroke]:not([stroke="none"]),
.dark .unlock-icon-wrapper svg[stroke]:not([stroke="none"]) *,
.dark .unlock-icon-wrapper svg [stroke]:not([stroke="none"]),
.dark .content-title-icon svg[stroke]:not([stroke="none"]),
.dark .content-title-icon svg[stroke]:not([stroke="none"]) *,
.dark .content-title-icon svg [stroke]:not([stroke="none"]) {
    stroke: var(--color-white) !important;
}

/* Force white fill if present on the SVG or any child element (excluding "none") */
.dark .content-cats-icon svg[fill]:not([fill="none"]),
.dark .content-cats-icon svg [fill]:not([fill="none"]),
.dark .single-page-icon svg[fill]:not([fill="none"]),
.dark .single-page-icon svg [fill]:not([fill="none"]),
.dark .unlock-icon-wrapper svg[fill]:not([fill="none"]),
.dark .unlock-icon-wrapper svg [fill]:not([fill="none"]),
.dark .content-title-icon svg[fill]:not([fill="none"]),
.dark .content-title-icon svg [fill]:not([fill="none"]) {
    fill: var(--color-white) !important;
}

/* Ensure hollow elements stay hollow */
.dark .content-cats-icon svg[fill="none"] *,
.dark .single-page-icon svg[fill="none"] *,
.dark .unlock-icon-wrapper svg[fill="none"] *,
.dark .content-title-icon svg[fill="none"] *,
.dark .content-cats-icon svg[fill="none"],
.dark .single-page-icon svg[fill="none"],
.dark .unlock-icon-wrapper svg[fill="none"],
.dark .content-title-icon svg[fill="none"],
.dark .content-cats-icon svg [fill="none"],
.dark .single-page-icon svg [fill="none"] {
    fill: none !important;
}

/* Handle elements without fill attributes that default to solid fill */
.dark .content-cats-icon svg:not([fill="none"]) path:not([fill]),
.dark .single-page-icon svg:not([fill="none"]) path:not([fill]),
.dark .unlock-icon-wrapper svg:not([fill="none"]) path:not([fill]),
.dark .content-title-icon svg:not([fill="none"]) path:not([fill]),
.dark .content-cats-icon svg:not([fill="none"]) rect:not([fill]),
.dark .single-page-icon svg:not([fill="none"]) rect:not([fill]),
.dark .unlock-icon-wrapper svg:not([fill="none"]) rect:not([fill]),
.dark .content-title-icon svg:not([fill="none"]) rect:not([fill]),
.dark .content-cats-icon svg:not([fill="none"]) circle:not([fill]),
.dark .single-page-icon svg:not([fill="none"]) circle:not([fill]),
.dark .unlock-icon-wrapper svg:not([fill="none"]) circle:not([fill]),
.dark .content-title-icon svg:not([fill="none"]) circle:not([fill]) {
    fill: var(--color-white) !important;
}

/* Support for icons using currentColor */
.dark .text-primary,
.dark .content-cats-icon svg[stroke="currentColor"] *,
.dark .single-page-icon svg[stroke="currentColor"] *,
.dark .content-title-icon svg[stroke="currentColor"] *,
.dark .unlock-icon-wrapper svg[stroke="currentColor"] * {
    color: var(--color-white) !important;
    stroke: var(--color-white) !important;
}

/* Unify icon backgrounds in dark mode */
.dark .content-title-icon,
.dark .content-cats-icon,
.dark .single-page-icon,
.dark .unlock-icon-wrapper {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Theme Switcher Icon */
.dark .theme-change-color .header-language-btn {
    background-color: #f8f9fa !important;
}

.dark .theme-change-color .header-language-btn i {
    color: #212529 !important;
}



/* ── Global Upload Zone Refinement ── */

.upload-zone {
    border: 2px dashed var(--color-border) !important;
    background: rgba(0, 0, 0, 0.01) !important;
    transition: all 0.2s ease-in-out !important;
    border-radius: 1rem !important;
}

.upload-zone:hover {
    border-color: var(--color-primary) !important;
    background: rgba(76, 63, 242, 0.03) !important;
    transform: translateY(-2px);
}

.dark .upload-zone {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.01) !important;
}

.dark .upload-zone:hover {
    border-color: #0d6efd !important;
    background: rgb(173 173 173 / 8%) !important;
}


.upload-zone i {
    transition: transform 0.3s ease;
}

.upload-zone:hover i {
    transform: scale(1.1);
}

/* ── Global Dark Mode Utility Overrides ── */

.dark .bg-white,
.dark .bg-light,
.dark .card.bg-light,
.dark .card.bg-white {
    background-color: var(--color-dark-light) !important;
    border-color: var(--color-dark-lighter) !important;
}

.dark .card {
    background-color: var(--color-dark-light);
    border-color: var(--color-dark-lighter);
}

.dark .card-header,
.dark .card-footer {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: var(--color-dark-lighter) !important;
    color: #e5e7eb !important;
}

.dark .form-control,
.dark .form-select {
    background-color: var(--color-dark-lighter) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--color-white) !important;
}

.dark .form-control:focus,
.dark .form-select:focus {
    background-color: var(--color-dark-lighter) !important;
    border-color: var(--color-primary) !important;
}

.dark .form-range::-webkit-slider-runnable-track {
    background-color: var(--color-dark-lighter) !important;
}

.dark .form-range::-moz-range-track {
    background-color: var(--color-dark-lighter) !important;
}

.dark hr {
    border-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 1;
}

/* Tables in Dark Mode */
.dark .table {
    color: #e5e7eb !important;
}

.dark .table thead th {
    background-color: var(--color-dark-lighter) !important;
    color: var(--color-white) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .table td {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.dark .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Soft Backgrounds in Dark Mode */
.dark .bg-primary-soft { background-color: rgba(76, 63, 242, 0.15) !important; color: #a59cf7 !important; }
.dark .bg-success-soft { background-color: rgba(16, 185, 129, 0.15) !important; color: #6ee7b7 !important; }
.dark .bg-warning-soft { background-color: rgba(245, 158, 11, 0.15) !important; color: #fcd34d !important; }
.dark .bg-danger-soft { background-color: rgba(239, 68, 68, 0.15) !important; color: #fca5a5 !important; }
.dark .bg-info-soft { background-color: rgba(6, 182, 212, 0.15) !important; color: #67e8f9 !important; }

/* ── Dark Mode Contrast Fixes ── */

.dark .text-dark,
.dark .text-black,
.dark .fw-bold.text-dark {
    color: #ddd !important;
}



.dark .tool-description-content,
.dark .tool-description-content p,
.dark .tool-description-content span,
.dark .tool-description-content li,
.dark .single-page-sec p,
.dark .single-page-sec .single-page-inner p,
.dark .single-page-sec li,
.dark .single-page-sec h1,
.dark .single-page-sec h2,
.dark .single-page-sec h3,
.dark .single-page-sec h4 {
    color: #e5e7eb !important; /* Brighter gray (Tailwind gray-200) for better legibility */
}

.dark .tool-description-content strong,
.dark .single-page-sec strong,
.dark .single-page-sec h1,
.dark .single-page-sec h2,
.dark .single-page-sec h3 {
    color: var(--color-white) !important;
}

/* Fix text-muted in dark mode for better visibility across the platform */
.dark .text-muted, 
.dark .text-secondary,
.dark .dark\:text-gray-400 {
    color: #9ca3af !important; /* Tailwind gray-400 equivalent */
}

.dark .dark\:text-light {
    color: #f3f4f6 !important;
}

.dark .dark\:text-white {
    color: #ffffff !important;
}


/* Ensure tool description section has proper spacing and contrast */
.tool-description-section {
    padding: 2.5rem;
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    margin-top: 4rem !important;
    margin-bottom: 2rem;
}

.dark .tool-description-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-description-content {
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Cloudflare Turnstile uses its responsive widget without restyling tool forms. */
.site-turnstile { min-width: 200px; max-width: 100%; }

.site-logout-button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; }
