/*
  ============================================================================
  HOMEPAGE STYLESHEET — everything specific to the homepage lives here.
  ============================================================================
  This is the ONLY file you need to edit to change how the homepage looks:
  hero section, search bar, tool listing, "Why us" info cards, FAQ, and
  newsletter card. It's loaded ONLY on the homepage (see the @section('styles')
  block at the top of resources/views/frontend/home.blade.php), so editing
  anything in here is safe — it can never affect the navbar, footer, or any
  other page on the site.

  Design tokens used below (--df-space-*, --df-radius-*, --df-shadow-*,
  --df-accent*, --df-border, --df-surface*, --df-text, --df-muted, colors
  like --color-primary/--color-text/--color-muted) are defined site-wide in
  public/css/app.css and public/css/df-redesign.css — safe to reuse here,
  just don't redefine them in this file.

  This file is served directly (no ".min.css" copy to keep in sync) — just
  save and refresh.
  ============================================================================
*/

/* ==========================================================================
   1. HERO SECTION
   ========================================================================== */

.home-hero-clean {
    position: relative;
    overflow: hidden;
    padding: clamp(1.25rem, 2.5vw, 1.75rem) 1rem clamp(1.5rem, 3vw, 2.25rem);
    margin-bottom: var(--space-6);
}

.home-hero-clean > * {
    position: relative;
    z-index: 1;
}

.home-hero-title {
    max-width: 1070px;
    margin: 0 auto var(--space-4);
    font-size: clamp(1.75rem, 3.8vw, 2.9rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    /* Matches the individual tool pages' .hero-title treatment (app.css)
       instead of plain text — ties the homepage title to the brand color. */
    background: linear-gradient(135deg, var(--color-primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-primary);
}

[data-bs-theme="dark"] .home-hero-title {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* The gradient-text "key phrase" inside the hero heading */
.home-hero-highlight {
    background: linear-gradient(135deg, var(--color-primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-primary); /* fallback if background-clip:text isn't supported */
}

.home-hero-lead {
    max-width: 1070px;
    margin: 0 auto var(--space-5);
    color: var(--color-muted);
    font-size: clamp(1rem, 1.3vw, 1.2rem);
}

/* Hero panel: background tint, radius, and mesh/grid depth layer.
   --df-hero-accent-rgb and --df-hero-radius come from Website Settings →
   Palette Settings → Homepage Hero Section (admin-configurable). */
.df-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--df-space-3);
    border-radius: var(--df-hero-radius, var(--df-radius-xl));
    /* Flat colour tint (no gradient) — driven by the admin-configurable
       Hero Accent Colour setting, so that control still has a real effect. */
    background: rgba(var(--df-hero-accent-rgb, 168, 85, 247), 0.08);
    isolation: isolate;
}

[data-bs-theme="dark"] .df-hero {
    background: rgba(var(--df-hero-accent-rgb, 168, 85, 247), 0.14);
}

.df-hero-copy {
    position: relative;
    z-index: 1;
}

.df-hero .home-hero-title {
    margin-bottom: var(--df-space-2);
}

.df-hero .home-hero-lead {
    margin-bottom: var(--df-space-5);
}

/* Minimal / search-first hero — title + short subtitle + search only.
   Selector is doubled up with .home-hero-clean so it beats that rule's
   padding regardless of stylesheet load order (both are single-class
   selectors on their own, which would otherwise tie). */
.home-hero-clean.df-hero-minimal {
    padding: clamp(1.25rem, 2.5vw, 1.75rem) 0 clamp(1.5rem, 3vw, 2rem);
}

.df-hero-minimal .df-hero-copy {
    max-width: min(100%, 1070px);
}

.df-hero-minimal .home-hero-title {
    max-width: 1070px;
    font-size: clamp(1.75rem, 3.8vw, 2.9rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.df-hero-minimal .home-hero-lead {
    max-width: 1070px;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.9;
    color: var(--df-text);
    opacity: 0.78;
}

/* ==========================================================================
   2. SEARCH BAR
   ========================================================================== */

.home-search-wrap {
    position: relative;
    max-width: 480px;
    margin: 0 auto var(--space-4);
}

.home-search-wrap i {
    position: absolute;
    top: 50%;
    left: 1.1rem;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: 1.05rem;
    pointer-events: none;
}

.home-search-input {
    width: 100%;
    padding: 0.65rem 1.1rem 0.65rem 2.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-md);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.home-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

/* Larger, custom accent focus ring — inside the .df-hero minimal hero */
.df-hero .home-search-wrap {
    max-width: 460px;
    margin-bottom: var(--df-space-2) !important;
}

.df-hero .home-search-input {
    height: 54px;
    padding-left: 3rem;
    border-radius: var(--df-radius-lg);
    border: 1px solid var(--df-border);
    box-shadow: var(--df-shadow-sm);
    font-size: 0.98rem;
}

.df-hero .home-search-input:focus {
    border-color: var(--df-accent);
    box-shadow: 0 0 0 4px var(--df-accent-soft), var(--df-shadow-md);
}

.df-hero .home-search-wrap i {
    left: 1.15rem;
    font-size: 1.15rem;
}

/* The homepage's own tool-grid section inherits .tool-section's generous
   top padding (up to 4rem) from app.css — fine elsewhere, but right under
   the hero it's most of the excess whitespace this file tightens up.
   Scoped to #toolsGrid only, so related-tools sections on individual tool
   pages (same .tool-grid-section class, styled from app.css/df-redesign.css)
   keep their normal spacing. */
#toolsGrid .tool-grid-section {
    padding-top: var(--df-space-3) !important;
}

/* ==========================================================================
   3. TOOL LISTING (dense list-row layout — the "2 per row" option in
   Website Settings → Homepage → Tool Grid Layout). The icon-tile grid
   option (4/6/8 per row) reuses the shared .home-tools-grid styling in
   app.css/df-redesign.css instead, since that same tile design is also used
   for "Explore More Tools" on individual tool pages.
   ========================================================================== */

.home-tools-grid.df-tool-list {
    display: grid;
    grid-template-columns: repeat(var(--cards-per-row, 2), minmax(0, 1fr)) !important;
    gap: var(--df-space-3) !important;
}

@media (max-width: 767.98px) {
    .home-tools-grid.df-tool-list {
        grid-template-columns: 1fr !important;
    }
}

.df-tool-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    justify-content: flex-start !important;
    gap: var(--df-space-3) !important;
    padding: var(--df-space-3) var(--df-space-4) !important;
    width: 100%;
    border-radius: var(--df-radius-md) !important;
    transition: border-color var(--df-transition-fast), transform var(--df-transition-fast), box-shadow var(--df-transition-fast);
}

.df-tool-row:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.32) !important;
    transform: translateY(-1px);
    box-shadow: var(--df-shadow-sm);
}

.df-tool-row .tool-card-icon {
    flex-shrink: 0;
    margin: 0 !important;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.3rem !important;
}

.df-tool-row-body {
    min-width: 0;
    flex: 1;
}

.df-tool-row .home-tool-title {
    font-size: 0.95rem;
    margin-bottom: 0.15rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.df-tool-row-desc {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--df-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.df-tool-row-arrow {
    flex-shrink: 0;
    color: var(--df-muted);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--df-transition-fast), transform var(--df-transition-fast), color var(--df-transition-fast);
}

.df-tool-row:hover .df-tool-row-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--df-accent);
}

/* ==========================================================================
   4. "WHY US" INFO CARDS
   ========================================================================== */

.home-info-section {
    padding-top: clamp(1.5rem, 3vw, 2.5rem) !important;
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem) !important;
}

.home-info-section .section-heading {
    margin-bottom: var(--df-space-5) !important;
}

.home-info-section .section-heading h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem) !important;
}

.home-info-section .dynamic-card-item {
    padding: var(--df-space-5) var(--df-space-4) !important;
    border: 1px solid var(--df-border) !important;
    border-radius: var(--df-radius-lg) !important;
    box-shadow: none !important;
    background: var(--df-surface) !important;
    transition: transform var(--df-transition), border-color var(--df-transition), box-shadow var(--df-transition) !important;
}

.home-info-section .dynamic-card-item:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.3) !important;
    box-shadow: var(--df-shadow-md) !important;
}

.home-info-section .dynamic-card-icon {
    width: 2.75rem !important;
    height: 2.75rem !important;
    background: var(--df-accent-gradient) !important;
    color: #fff !important;
    box-shadow: var(--df-shadow-sm);
}

.home-info-section .dynamic-card-title {
    font-weight: 700;
    letter-spacing: -0.005em;
}

.home-info-section .dynamic-card-description {
    font-size: 0.85rem;
}

/* ==========================================================================
   5. FAQ
   ========================================================================== */

.df-faq-section {
    padding: clamp(2rem, 4vw, 3rem) 0 !important;
    border-top: none !important;
}

.df-faq-section .section-heading {
    margin-bottom: var(--df-space-5) !important;
}

.df-faq-section .section-heading h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem) !important;
}

.df-faq-accordion .accordion-item {
    margin-bottom: var(--df-space-3) !important;
    border: 1px solid var(--df-border) !important;
    border-radius: var(--df-radius-md) !important;
    background: var(--df-surface) !important;
    box-shadow: none !important;
    overflow: hidden;
    transition: border-color var(--df-transition-fast), box-shadow var(--df-transition-fast), transform var(--df-transition-fast);
}

.df-faq-accordion .accordion-item:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.28) !important;
    box-shadow: var(--df-shadow-sm) !important;
    transform: translateY(-1px);
}

.df-faq-accordion .accordion-button {
    padding: 0.9rem 1.1rem !important;
    font-size: 0.92rem;
    font-weight: 700 !important;
    background: transparent !important;
    box-shadow: none !important;
    gap: 0.6rem;
}

.df-faq-accordion .accordion-button .bi-question-circle {
    color: var(--df-accent) !important;
    font-size: 0.9em;
}

.df-faq-accordion .accordion-button:not(.collapsed) {
    background: var(--df-accent-soft) !important;
    color: var(--df-accent) !important;
    border-bottom: 1px solid var(--df-border) !important;
}

/* Kill Bootstrap's built-in chevron background-image — replaced by our SVG */
.df-faq-accordion .accordion-button::after {
    display: none !important;
    content: none !important;
    background-image: none !important;
}

.df-accordion-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    width: 1.4rem;
    height: 1.4rem;
    color: var(--df-muted);
    transition: transform var(--df-transition), color var(--df-transition-fast);
}

.df-faq-accordion .accordion-button:not(.collapsed) .df-accordion-chevron {
    transform: rotate(180deg);
    color: var(--df-accent);
}

.df-faq-accordion .accordion-body {
    padding: 0.2rem 1.1rem 1rem !important;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--df-muted) !important;
}

/* ==========================================================================
   6. NEWSLETTER CARD
   ========================================================================== */

.df-newsletter-section {
    padding-top: clamp(1.5rem, 3vw, 2.5rem) !important;
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem) !important;
}

.df-newsletter-card {
    background: linear-gradient(135deg, var(--df-surface) 0%, var(--df-surface-soft) 100%) !important;
    border: 1px solid var(--df-border) !important;
    border-radius: var(--df-radius-xl) !important;
    padding: clamp(1.75rem, 4vw, 2.5rem) !important;
    box-shadow: none !important;
    transition: box-shadow var(--df-transition), border-color var(--df-transition);
}

.df-newsletter-card:hover {
    box-shadow: var(--df-shadow-md) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.24) !important;
}

.df-newsletter-card h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem) !important;
}

.df-newsletter-card .tool-newsletter-form .form-control {
    border-radius: var(--df-radius-md) !important;
    border: 1px solid var(--df-border) !important;
    box-shadow: none !important;
}

.df-newsletter-card .tool-newsletter-form .form-control:focus {
    border-color: var(--df-accent) !important;
    box-shadow: 0 0 0 4px var(--df-accent-soft) !important;
}

.df-newsletter-card .tool-newsletter-form .btn-primary-custom {
    border-radius: var(--df-radius-md) !important;
    background: var(--df-accent-gradient) !important;
    border: none !important;
    transition: transform var(--df-transition-fast), box-shadow var(--df-transition-fast);
}

.df-newsletter-card .tool-newsletter-form .btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: var(--df-shadow-sm);
}

/* ==========================================================================
   7. FULL-WIDTH LAYOUT
   ========================================================================== */

/* Breaks the homepage out of the normal centered .container, so it spans
   the full viewport width like the navbar does. */
.tool-page.home-page-fullwidth {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: clamp(1rem, 4vw, 3rem);
    padding-right: clamp(1rem, 4vw, 3rem);
    box-sizing: border-box;
}
