/* ═══════════════════════════════════════════════════════
   tools.css — Styles for Favorites, Nickname Gen, Bio Builder
   ═══════════════════════════════════════════════════════ */

/* ── Tool Panel (togglable like mixer) ── */
.tool-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: fadeInUp 0.3s ease both;
}

.tool-panel__header {
    margin-bottom: 1rem;
}

.tool-panel__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
}

.tool-panel__subtitle {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin: 0;
}

/* Active state for toolbar buttons */
.toolbar-btn--active {
    background: var(--grad-brand, linear-gradient(135deg, #a855f7, #ec4899)) !important;
    color: #fff !important;
}

/* ── Tool Tab Bar (above input) ── */
.tool-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.35rem;
    border: 1px solid rgba(168, 85, 247, 0.12);
}

.tool-tab {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    color: var(--c-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.tool-tab:hover {
    background: rgba(168, 85, 247, 0.08);
    color: var(--c-text, #e2e8f0);
}

.tool-tab--active {
    background: rgba(168, 85, 247, 0.15);
    color: #e879f9;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.3);
}

@media (max-width: 600px) {
    .tool-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        padding-bottom: 2px;
    }

    .tool-tabs::-webkit-scrollbar {
        display: none;
    }

    .tool-tab {
        flex: 0 0 auto;
        font-size: 0.82rem;
        padding: 0.55rem 0.9rem;
        scroll-snap-align: start;
    }
}

.fav-star {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--c-text-muted);
    transition: color 0.2s, transform 0.2s;
    padding: 2px 4px;
    line-height: 1;
}

.fav-star:hover {
    transform: scale(1.3);
    color: #fbbf24;
}

.fav-star--active {
    color: #fbbf24;
}

.font-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Tool Sections Common ── */
.tool-section {
    border-top: none;
}

/* ═══════════════════════════════════════════════════════
   NICKNAME GENERATOR
   ═══════════════════════════════════════════════════════ */

.nickname-panel {
    margin-top: 0.5rem;
}

.nickname-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.nickname-input {
    flex: 1;
    min-width: 180px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: var(--c-bg, rgba(0, 0, 0, 0.3));
    color: var(--c-text, #e2e8f0);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.nickname-input:focus {
    border-color: rgba(168, 85, 247, 0.6);
}

.nickname-select {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: var(--c-bg, rgba(0, 0, 0, 0.3));
    color: var(--c-text, #e2e8f0);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.nickname-generate-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    background: var(--grad-brand, linear-gradient(135deg, #a855f7, #ec4899));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.nickname-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.nickname-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.nickname-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--c-text-muted);
    padding: 2rem 1rem;
    font-size: 1rem;
}

.nickname-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    animation: fadeInUp 0.3s ease both;
    transition: border-color 0.2s;
}

.nickname-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
}

.nickname-text {
    font-size: 1.05rem;
    word-break: break-all;
    flex: 1;
    margin-right: 0.75rem;
}

.nickname-copy {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: transparent;
    color: var(--c-text, #e2e8f0);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nickname-copy:hover {
    background: rgba(168, 85, 247, 0.15);
}

.nickname-copy--done {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--c-success);
}

/* ═══════════════════════════════════════════════════════
   INSTAGRAM BIO BUILDER
   ═══════════════════════════════════════════════════════ */

.bio-panel {
    margin-top: 0.5rem;
}

/* Template Picker Grid */
.bio-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.bio-template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.15);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    color: var(--c-text, #e2e8f0);
}

.bio-template-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.08);
    transform: translateY(-2px);
}

.bio-template-card--active {
    border-color: rgba(168, 85, 247, 0.6);
    background: rgba(168, 85, 247, 0.12);
}

.bio-template-emoji {
    font-size: 1.5rem;
}

.bio-template-label {
    font-size: 0.72rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Editor */
.bio-editor {
    margin-bottom: 1.25rem;
}

.bio-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: 0.5rem;
}

.bio-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: var(--c-bg, rgba(0, 0, 0, 0.3));
    color: var(--c-text, #e2e8f0);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.bio-textarea:focus {
    border-color: rgba(168, 85, 247, 0.6);
}

.bio-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.75rem;
}

.bio-counter {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    white-space: nowrap;
}

.bio-font-select {
    flex: 1;
    max-width: 280px;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: var(--c-bg, rgba(0, 0, 0, 0.3));
    color: var(--c-text, #e2e8f0);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

/* Preview Box */
.bio-preview-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
}

.bio-preview-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.bio-preview-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--c-text, #e2e8f0);
    white-space: pre-line;
    min-height: 60px;
    word-break: break-word;
}

.bio-copy-btn {
    margin-top: 1rem;
    width: 100%;
}

/* ── Shared animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .nickname-controls {
        flex-direction: column;
    }

    .nickname-results {
        grid-template-columns: 1fr;
    }

    .bio-templates {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .bio-editor-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .bio-font-select {
        max-width: 100%;
    }
}