/* components.css - Cards, Buttons, Inputs, Modals, Results */

/* ============================================================
   style.css — Complete Design System for CuteFonts Generator
   ============================================================ */


/* ============================================================
   4. GENERATOR & INPUT CARD
   ============================================================ */

.generator {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--s-xl) var(--s-3xl);
}

.input-card {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: var(--s-xl);
}

.input-card__glow {
    position: absolute;
    inset: 0;
    border-radius: var(--r-lg);
    padding: 1.5px;
    background: var(--grad-glow);
    background-size: 300% 300%;
    animation: glowSpin 6s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity var(--t-base);
    z-index: 0;
    pointer-events: none;
}

.input-card:focus-within .input-card__glow {
    opacity: 1;
}

@keyframes glowSpin {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.input-card__textarea {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    min-height: 180px;
    padding: var(--s-2xl) var(--s-xl);
    background: var(--c-surface-solid);
    border: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text);
    outline: none;
    resize: vertical;
    text-align: center;
    line-height: 1.5;
    letter-spacing: -0.3px;
}

.input-card__textarea::placeholder {
    color: var(--c-text-muted);
    font-weight: 500;
}

.input-card__toolbar {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-sm);
    padding: var(--s-md) var(--s-xl);
    background: rgba(10, 10, 20, 0.85);
    border-top: 1px solid var(--c-border);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.input-card__counter {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.input-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-sm);
}


/* ============================================================
   5. TOOLBAR BUTTONS
   ============================================================ */

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--c-text-secondary);
    transition: all var(--t-fast);
    white-space: nowrap;
    min-height: 44px;          /* WCAG 2.2 touch target */
    box-sizing: border-box;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--c-border-hover);
    color: var(--c-text);
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: scale(0.96);
}

/* ── Options popover (declutters the input toolbar) ── */
.options-menu {
    position: relative;
    display: inline-flex;
}

.options-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    min-width: 210px;
    background: var(--c-surface, #15152a);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.options-panel[hidden] {
    display: none;
}

.options-panel .toolbar-btn {
    width: 100%;
    justify-content: flex-start;
}

/* ── "More free tools" entry row (surfaces the buried on-page studios) ── */
.more-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-sm);
    margin: var(--s-xl) 0 var(--s-lg);
    padding-top: var(--s-lg);
    border-top: 1px solid var(--c-border);
}

.more-tools__label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--c-text-secondary);
}

.more-tools__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    min-height: 40px;
    box-sizing: border-box;
    border-radius: var(--r-full, 999px);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--c-text);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--t-fast);
}

.more-tools__chip:hover,
.more-tools__chip:focus-visible {
    background: var(--grad-brand);
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Live style search ── */
.style-search {
    margin-bottom: var(--s-md);
}

.style-search__input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 16px;            /* >=16px: no iOS focus-zoom */
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--c-text);
    transition: border-color var(--t-fast);
}

.style-search__input::placeholder {
    color: var(--c-text-muted);
}

.style-search__input:focus-visible {
    outline: none;
    border-color: var(--c-pink);
}

/* ── "Show all styles" toggle (ends the curated default view) ── */
.show-all-btn {
    grid-column: 1 / -1;
    margin-top: var(--s-md);
    min-height: 44px;
    padding: 14px;
    border-radius: var(--r-md);
    border: 1px dashed var(--c-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--c-text);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t-fast);
}

.show-all-btn:hover,
.show-all-btn:focus-visible {
    background: var(--grad-brand);
    border-color: transparent;
    color: #fff;
}

/* E-E-A-T trust byline (footer) */
.footer__byline {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    opacity: 0.65;
    max-width: 70ch;
}

/* ── In-depth per-page guide (SEO content depth) ── */
.page-guide__inner {
    max-width: 760px;
}

.page-guide__inner h3 {
    margin: 1.6rem 0 0.6rem;
    font-size: 1.25rem;
}

.page-guide__inner h3:first-child {
    margin-top: 0;
}

.page-guide__inner p {
    line-height: 1.7;
    margin: 0 0 1rem;
    color: var(--c-text-secondary);
}

.page-guide__inner ul {
    margin: 0 0 1rem 1.2rem;
    line-height: 1.7;
    color: var(--c-text-secondary);
}

.page-guide__inner li {
    margin-bottom: 0.5rem;
}

.page-guide__inner a {
    color: var(--c-pink);
}

.page-guide__inner code {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: rgba(127, 127, 127, 0.18);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

.toolbar-btn__icon {
    font-size: 0.95rem;
}

.toolbar-btn--accent {
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--c-purple);
    background: rgba(168, 85, 247, 0.08);
}

.toolbar-btn--accent:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.toolbar-btn--primary {
    background: var(--grad-brand);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 45, 120, 0.25);
}

.toolbar-btn--primary:hover {
    box-shadow: 0 6px 25px rgba(255, 45, 120, 0.4);
    transform: translateY(-2px);
}


/* ============================================================
   6. FILTER CHIPS
   ============================================================ */

.filters {
    margin-bottom: var(--s-xl);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filters__track {
    display: flex;
    gap: var(--s-sm);
    padding: var(--s-xs) var(--s-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.filter-chip {
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: var(--r-full);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--c-border);
    transition: all var(--t-fast);
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--c-border-hover);
    color: var(--c-text);
    transform: translateY(-2px);
}

.filter-chip--active,
.filter-chip.active {
    background: var(--grad-brand);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(255, 45, 120, 0.3);
}


/* ============================================================
   7. RESULTS GRID & FONT CARDS
   ============================================================ */

.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s-lg);
}

.font-card {
    background: var(--c-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: var(--s-xl);
    display: flex;
    flex-direction: column;
    gap: var(--s-md);
    transition: all var(--t-base);
    position: relative;
    overflow: hidden;
}

.font-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 45, 120, 0.03), rgba(168, 85, 247, 0.03));
    opacity: 0;
    transition: opacity var(--t-base);
}

.font-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(168, 85, 247, 0.08);
}

.font-card:hover::before {
    opacity: 1;
}

.font-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.font-card-output {
    font-size: 1.35rem;
    line-height: 1.5;
    color: var(--c-text);
    word-break: break-all;
    min-height: 40px;
    position: relative;
    z-index: 1;
}

.copy-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    min-height: 44px;
    /* WCAG 2.2 target size; outer height pinned to 44px */
    box-sizing: border-box;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    color: var(--c-text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--c-border);
    transition: all var(--t-fast);
    position: relative;
    z-index: 1;
}

/* ── Favorite star: >=44x44px tap target (WCAG 2.2) ──
   Defined here with .font-card-title specificity (0,0,2,0) so it wins over
   the single-class .fav-star rule in tools.css regardless of stylesheet load
   order (components.css is linked BEFORE tools.css in index.html). The visible
   glyph stays small; the larger box is transparent tap area. Negative top/bottom
   margins keep the 44px hit area from growing the title row's effective height
   (no layout shift). No negative RIGHT margin — that would push the star under
   the absolutely-positioned top-right compat badge. */
.font-card-title .fav-star {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: -10px;
    margin-bottom: -10px;
    flex-shrink: 0;
}

/* Reserve right padding in the title row so the enlarged 44px star sits clear
   of the top-right compat badge (badge: top:10px; right:10px; 22px wide -> its
   left edge is 32px from the card's right; the card has 32px (--s-xl) padding,
   so this gutter keeps the star's tap area from crowding the badge). */
.font-card-title {
    padding-right: 28px;
}

.copy-btn:hover {
    background: var(--grad-brand);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 45, 120, 0.3);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: scale(0.95);
}

.font-card.copied-success {
    border-color: var(--c-cyan) !important;
    box-shadow: 0 0 25px rgba(6, 214, 160, 0.2) !important;
}

.placeholder-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--s-3xl);
    border-style: dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-md);
}

.placeholder-card__icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.placeholder-card__text {
    font-size: 1rem;
    color: var(--c-text-muted);
}


/* ============================================================
   9. TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    bottom: var(--s-xl);
    bottom: calc(var(--s-xl) + env(safe-area-inset-bottom, 0px)); /* notch / home-indicator */
    right: var(--s-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--s-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--s-sm);
    padding: var(--s-md) var(--s-lg);
    border-radius: var(--r-md);
    background: var(--c-surface-solid);
    border: 1px solid var(--c-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all var(--t-base);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.success {
    border-color: rgba(6, 214, 160, 0.3);
}

.toast.warning {
    border-color: rgba(255, 200, 0, 0.3);
}

/* ============================================================
   11. ADVANCED FEATURES CARDS (NEW)
   ============================================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--s-xl);
    margin-top: var(--s-2xl);
}

.feature-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-2xl);
    text-align: center;
    transition: all var(--t-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(168, 85, 247, 0.1);
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 45, 120, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--t-base);
    z-index: 0;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(255, 45, 120, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--s-lg);
    position: relative;
    z-index: 1;
}

.feature-card__icon-inner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 45, 120, 0.4);
}

.feature-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: var(--s-md);
    position: relative;
    z-index: 1;
}

.feature-card__desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--c-text-secondary);
    position: relative;
    z-index: 1;
}

/* ============================================================
   12. OUR TOOLS GRID (NEW)
   ============================================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--s-md);
    margin-top: var(--s-2xl);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.tool-link-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--r-md);
    padding: var(--s-lg);
    display: flex;
    align-items: center;
    gap: var(--s-md);
    text-decoration: none;
    color: var(--c-text-secondary);
    transition: all var(--t-fast);
}

.tool-link-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--c-text);
    transform: translateY(-2px);
}

.tool-link-card__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tool-link-card__text {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

/* ═══════ Adsterra native ad slots (codes managed in js/ads-terra.js) ═══════ */
/* Height is reserved up-front so lazy-loaded ads never shift the layout (CLS). */
.ad-slot {
    display: block;
    width: 100%;
    max-width: 728px;
    min-height: 250px;
    margin: 2rem auto;
    clear: both;
    text-align: center;
    overflow: hidden;
}

.ad-slot[data-ad-state="duplicate"],
.ad-slot[data-ad-state="unfilled"] {
    display: none;
}

@media (max-width: 600px) {
    .ad-slot {
        min-height: 200px;
        margin: 1.5rem auto;
    }
}