/**
 * Letras Diferentes — PT-BR Font Generator
 * CSS v1.0.0
 * Mobile-first | 360px+ safe | Dark mode ready
 */

/* ============================================================
   BASE WRAPPER
   ============================================================ */
.ld-wrapper {
    --ld-primary:     #7C3AED;
    --ld-primary-hover:#6D28D9;
    --ld-accent:      #F59E0B;
    --ld-success:     #10B981;
    --ld-danger:      #EF4444;
    --ld-bg:          #FFFFFF;
    --ld-surface:     #F8F7FF;
    --ld-border:      #E5E7EB;
    --ld-text:        #1F2937;
    --ld-text-muted:  #6B7280;
    --ld-radius:      12px;
    --ld-radius-sm:   8px;
    --ld-shadow:      0 2px 8px rgba(0,0,0,.08);
    --ld-shadow-md:   0 4px 16px rgba(0,0,0,.12);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--ld-text);
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ============================================================
   INPUT AREA
   ============================================================ */
.ld-input-area {
    background: var(--ld-surface);
    border: 2px solid var(--ld-border);
    border-radius: var(--ld-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.ld-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100% ;
}

.ld-input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    border: 2px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    background: #fff;
    color: var(--ld-text);
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
}

.ld-input:focus {
    border-color: var(--ld-primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

.ld-input::placeholder {
    color: var(--ld-text-muted);
}

/* ── Buttons ── */
.ld-btn {
   height: 48px;
    min-width: 40px;   /* ← 40px karo */
    width: 40px;       /* ← yeh line add karo */
    padding: 0;        /* ← padding zero */
    border: 2px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ld-btn:hover {
    border-color: var(--ld-primary);
    background: var(--ld-surface);
}

.ld-clear-btn:hover { border-color: var(--ld-danger); }
.ld-random-btn:hover { border-color: var(--ld-accent); }

/* ── Character Counter ── */
.ld-char-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ld-text-muted);
    flex-wrap: wrap;
}

.ld-char-count {
    font-weight: 700;
    color: var(--ld-primary);
    transition: color .15s;
}

.ld-char-count.ld-over-limit {
    color: var(--ld-danger);
}

.ld-char-note {
    color: var(--ld-accent);
    font-weight: 600;
}

/* ── Category Filters ── */
.ld-cat-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.ld-cat-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 20px;
    border: 1.5px solid var(--ld-border);
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: var(--ld-text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.ld-cat-btn:hover,
.ld-cat-btn.active {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
    color: #fff;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.ld-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    color: var(--ld-text-muted);
    font-size: 14px;
}

.ld-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--ld-border);
    border-top-color: var(--ld-primary);
    border-radius: 50%;
    animation: ld-spin .6s linear infinite;
    flex-shrink: 0;
}

@keyframes ld-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   RESULTS GRID
   ============================================================ */
.ld-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

/* ── Result Item ── */
.ld-result-item {
    background: #fff;
    border: 1.5px solid var(--ld-border);
    border-radius: var(--ld-radius);
    padding: 20px;              /* ← 14 se 20 */
    display: flex;
    flex-direction: column;
    gap: 10px;                  /* ← 8 se 10 */
    transition: box-shadow .15s, border-color .15s;
    position: relative;

}

.ld-result-item:hover {
    box-shadow: var(--ld-shadow-md);
    border-color: var(--ld-primary);
        background: var(--ld-surface);   /* ← yeh line add karo */

}

/* Plain items get subtle purple left border */
.ld-item-plain {
    border-left: 3px solid var(--ld-primary);
}

/* Decorated items get amber left border */
.ld-item-deco {
    border-left: 3px solid var(--ld-accent);
}

/* ── Meta Row ── */
.ld-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ld-font-name {
    display: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--ld-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.ld-deco-label {
    font-size: 10px;
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

/* ── Style Text — clamp() for responsive sizing ── */
.ld-style-text {
    font-size: clamp(18px, 4vw, 24px);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 28px;
    color: var(--ld-text);
    flex: 1;
}

/* ── Platform Badges ── */
.ld-platform-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ld-platform-badge {
    font-size: 16px;
    cursor: default;
    position: relative;
    transition: transform .15s;
}

.ld-platform-badge:hover { transform: scale(1.2); }

.ld-badge-no {
    opacity: .35;
    filter: grayscale(1);
}

.ld-badge-ok {
    opacity: 1;
}

/* ── Copy Button ── */
.ld-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--ld-radius-sm);
    border: 1.5px solid var(--ld-primary);
    background: transparent;
    color: var(--ld-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    margin-top: auto;
    width: 100%;
}

.ld-copy-btn:hover {
    background: var(--ld-primary);
    color: #fff;
}

.ld-copy-btn.ld-copied {
    background: var(--ld-success);
    border-color: var(--ld-success);
    color: #fff;
}

/* ============================================================
   LOAD MORE
   ============================================================ */
.ld-load-more-wrap {
    text-align: center;
    padding: 24px 0 8px;
}

.ld-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 32px;
    border-radius: 24px;
    border: 2px solid var(--ld-primary);
    background: transparent;
    color: var(--ld-primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.ld-load-more-btn:hover {
    background: var(--ld-primary);
    color: #fff;
}

.ld-remaining-count {
    display: none;
    font-size: 12px;
    opacity: .7;
    font-weight: 400;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.ld-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ld-text-muted);
    font-size: 15px;
}

.ld-empty p {
    margin: 0;
}

/* ============================================================
   RESPONSIVE — 360px+ (Brazilian mobile minimum)
   ============================================================ */
@media (max-width: 480px) {
   .ld-wrapper {
        margin: 20px auto;    /* ← 40 se 20 */
        padding: 16px;        /* ← 30 se 16 */
                border-radius: 12px;

    }
   
    .ld-input-area {
        padding: 12px;        /* ← already hai, keep it */
                margin-bottom: 16px;

    }
.ld-input-row {
        gap: 6px;         /* ← 8 se 6 mobile pe */
    }
    .ld-input {
        font-size: 16px;
        height: 44px;
        min-width: 0;       /* ← CRITICAL: allows shrinking */
        flex: 1;            /* ← ADD: takes available space */
    }
    

    .ld-btn {
        height: 40px;   /* ← 44 se 40 karo */
        min-width: 36px; /* ← yeh karo */
        width: 36px;     /* ← yeh add karo */
        padding: 0;
        font-size: 16px; /* ← emoji size */
        flex-shrink: 0;  /* ← yeh add karo */
    }

  .ld-results {
        grid-template-columns: 1fr;
        gap: 10px;         /* ← 12 se 15 */
}

    /* clamp() handles .ld-style-text sizing — no override needed */

    .ld-cat-filters {
        gap: 4px;
    }

    .ld-cat-btn {
        height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    .ld-load-more-btn {
        width: 100%;
        justify-content: center;
    }

    .ld-result-item {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .ld-results {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-left: -4px;   /* ← ADD */
        margin-right: -4px;  /* ← ADD */
    }
}

/* ============================================================
   DARK MODE SUPPORT
   ============================================================ */
@media (prefers-color-scheme: dark) {
    .ld-wrapper {
        --ld-bg:      #0F0F0F;
        --ld-surface: #1A1A2E;
        --ld-border:  #2D2D45;
        --ld-text:    #F1F1F1;
        --ld-text-muted: #9CA3AF;
    }

    .ld-input,
    .ld-btn,
    .ld-result-item {
        background: #1A1A2E;
        color: #F1F1F1;
    }

    .ld-cat-btn {
        background: #1A1A2E;
        color: #9CA3AF;
    }

    .ld-deco-label {
        background: #3D2B00;
        color: #FCD34D;
    }
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.ld-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1F2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
    white-space: nowrap;
}

.ld-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #10B981;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.ld-toast.ld-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ld-toast.ld-toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: transform .2s ease, opacity .2s ease;
}

/* Mobile toast — thoda upar */
@media (max-width: 480px) {
    .ld-toast {
        bottom: 16px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* ============================================================
   ENTRY ANIMATION
   ============================================================ */
@keyframes ld-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ld-result-item {
    animation: ld-fade-in .2s ease both;
}
