/**
 * Letras Diferentes — PT-BR Font Generator
 * CSS v2.0.0 FINAL — Gaming Fire Theme
 * Mobile-first | 360px+ safe | Brazilian Free Fire vibes 🔥
 */

/* ============================================================
   BASE WRAPPER
   ============================================================ */
.ld-wrapper {
    /* ── Gaming Fire Theme (Brazil + Free Fire vibes) ── */
    --ld-primary:       #FF6B00;    /* 🔥 Orange Fire */
    --ld-primary-hover: #E65C00;    /* Darker Orange */
    --ld-accent:        #FFD700;    /* ⚡ Gold/Yellow */
    --ld-success:       #00FF41;    /* 🎮 Neon Green */
    --ld-danger:        #FF1744;    /* 💀 Red Danger */
    
    --ld-bg:            #0F1419;    /* 🌑 Dark Military BG */
    --ld-surface:       #1A1F26;    /* Slightly lighter surface */
    --ld-border:        #2D3748;    /* Dark borders */
    
    --ld-text:          #F7FAFC;    /* 💡 Almost white text */
    --ld-text-muted:    #A0AEC0;    /* Muted gray */
    
    --ld-radius:        12px;
    --ld-radius-sm:     8px;
    --ld-shadow:        0 4px 12px rgba(255,107,0,.15);
    --ld-shadow-md:     0 8px 24px rgba(255,107,0,.25);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--ld-text);
    max-width: 1180px;
    margin: 40px auto;
    padding: 30px;
    background: var(--ld-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,107,0,.2);
    position: relative;
}

/* Fire glow border effect */
.ld-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #FF6B00, #FFD700, #00FF41);
    border-radius: 18px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(8px);
}

/* ============================================================
   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: var(--ld-surface);
    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(255,107,0,.25);
}

.ld-input::placeholder {
    color: #718096;
}

/* ── Action Buttons ── */
.ld-btn {
    height: 48px;
    min-width: 40px;
    width: 40px;
    padding: 0;
    color: #FF6B00 !important; 
    border: 2px solid var(--ld-border);
    border-radius: var(--ld-radius-sm);
    background: var(--ld-surface);
    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);
        color: #FF6B00 !important; 

    background: #252D38;
    transform: translateY(-1px);
}

.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);
    text-shadow: 0 0 8px rgba(255,23,68,.5);
}

.ld-char-note {
    color: var(--ld-accent);
    font-weight: 600;
    text-shadow: 0 0 6px rgba(255,215,0,.4);
}

/* ── 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: var(--ld-surface);
    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;
    box-shadow: 0 0 12px rgba(255,107,0,.5);
    transform: translateY(-1px);
}

/* ============================================================
   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: var(--ld-surface);
    border: 1.5px solid var(--ld-border);
    border-radius: var(--ld-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all .2s ease;
    position: relative;
    animation: ld-fade-in .2s ease both;
}

.ld-result-item:hover {
    box-shadow: 0 4px 16px rgba(255,107,0,.2);
    border-color: var(--ld-primary);
    background: #252D38;
    transform: translateY(-2px);
}

/* Plain items — Gold left border */
.ld-item-plain {
    border-left: 3px solid var(--ld-accent);
}

/* Decorated items — Gold 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: linear-gradient(135deg, #FF6B00, #FFD700);
    color: #0F1419;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255,107,0,.3);
}

/* ── Style Text ── */
.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;
    box-shadow: 0 0 12px rgba(255,107,0,.3);
}

.ld-copy-btn.ld-copied {
    background: var(--ld-success);
    border-color: var(--ld-success);
    color: #0F1419;
    box-shadow: 0 0 16px rgba(0,255,65,.6);
}

/* ============================================================
   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 .2s;
}

.ld-load-more-btn:hover {
    background: var(--ld-primary);
    color: #fff;
    box-shadow: 0 0 16px rgba(255,107,0,.4);
    transform: translateY(-2px);
}

.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;
}

/* ============================================================
   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: #00FF41;
    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;
}

/* ============================================================
   RESPONSIVE — 360px+ (Brazilian mobile minimum)
   ============================================================ */
@media (max-width: 480px) {
    .ld-wrapper {
        margin: 20px auto;
        padding: 16px;
        border-radius: 12px;
    }

    .ld-input-area {
        padding: 12px;
        margin-bottom: 16px;
    }

    .ld-input-row {
        gap: 6px;
    }

    .ld-input {
        font-size: 16px; /* Prevents iOS zoom */
        height: 44px;
        min-width: 0;
        flex: 1;
    }

    .ld-btn {
        height: 40px;
        min-width: 36px;
        width: 36px;
        padding: 0;
        font-size: 16px;
        flex-shrink: 0;
    }

    .ld-results {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ld-result-item {
        padding: 16px;
    }

    .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-toast {
        bottom: 16px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .ld-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   ENTRY ANIMATION
   ============================================================ */
@keyframes ld-fade-in {
    from { 
        opacity: 0; 
        transform: translateY(8px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}