/**
 * Símbolos Tool CSS v1.0.0
 * Mobile-first | 360px+ safe | Toast ready
 */

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

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--st-text);
    background: var(--st-bg);
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

/* ============================================================
   SEARCH AREA
   ============================================================ */
.st-search-area {
    background: var(--st-surface);
    border: 2px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.st-search-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    border: 2px solid var(--st-border);
    border-radius: var(--st-radius-sm);
    background: #fff;
    color: var(--st-text);
    outline: none;
    transition: border-color .2s;
}

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

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

/* ============================================================
   CATEGORY TABS
   ============================================================ */
.st-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

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

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

/* ============================================================
   SYMBOLS GRID
   ============================================================ */
.st-symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

/* ── Symbol Item ── */
.st-symbol-item {
    background: #fff;
    border: 2px solid var(--st-border);
    border-radius: var(--st-radius-sm);
    padding: 16px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 5vw, 32px);
    min-height: 80px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
    overflow: hidden;
}

.st-symbol-item:hover {
    border-color: var(--st-primary);
    box-shadow: var(--st-shadow-md);
    transform: translateY(-2px);
}

.st-symbol-item:active {
    transform: translateY(0);
}

/* Copied state */
.st-symbol-item.copied {
    background: var(--st-success);
    border-color: var(--st-success);
    color: #fff;
}

.st-symbol-item.copied::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 12px;
    font-weight: 700;
}

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

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

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

.st-remaining-count {
    font-size: 12px;
    opacity: .7;
}

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

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.st-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;
    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;
}

.st-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--st-success);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

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

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .st-search-area {
        padding: 12px;
    }

    .st-search-input {
        font-size: 16px; /* iOS zoom prevention */
        height: 44px;
    }

    .st-symbols-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }

    .st-symbol-item {
        padding: 12px 6px;
        min-height: 70px;
        font-size: clamp(20px, 5vw, 28px);
    }

    .st-category-tabs {
        gap: 4px;
    }

    .st-cat-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 12px;
    }

    .st-toast {
        bottom: 16px;
        font-size: 13px;
        padding: 10px 16px;
    }

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

@media (min-width: 481px) and (max-width: 768px) {
    .st-symbols-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    }
}

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

    .st-search-input,
    .st-symbol-item {
        background: #1A1A2E;
        color: #F1F1F1;
    }

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

/* ============================================================
   ENTRY ANIMATION
   ============================================================ */
@keyframes st-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.st-symbol-item {
    animation: st-fade-in .2s ease both;
}
