/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f4ff;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-image: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
                      radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
header {
    text-align: center;
    margin-bottom: 28px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

.logo i {
    color: #6366f1;
    font-size: 1.8rem;
}

.tagline {
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 4px;
    font-weight: 400;
}

/* ============================================
   GENERATOR CARD
   ============================================ */
.generator-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 36px 34px 28px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.10),
                0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.08);
    transition: box-shadow 0.3s ease;
}

.generator-card:hover {
    box-shadow: 0 12px 48px rgba(99, 102, 241, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ============================================
   NAME DISPLAY
   ============================================ */
.name-display {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 16px;
    padding: 32px 28px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid #e8edf9;
    transition: all 0.3s ease;
    min-height: 96px;
}

.name-display:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.generated-name {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
    word-break: break-word;
    transition: all 0.3s ease;
    cursor: pointer;
}

.generated-name:hover {
    color: #6366f1;
}

.generated-name.pop {
    animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.copy-btn {
    background: rgba(99, 102, 241, 0.08);
    border: none;
    color: #6366f1;
    font-size: 1.2rem;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #6366f1;
    color: #ffffff;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #10b981;
    color: #ffffff;
}

.copy-btn.copied i {
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   CONTROLS
   ============================================ */
.controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-group label i {
    color: #6366f1;
    font-size: 0.7rem;
}

.control-group select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    background: #fafbfc;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.control-group select:hover {
    border-color: #c7cbd6;
    background-color: #ffffff;
}

.control-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background-color: #ffffff;
}

/* ============================================
   ACTION ROW (Generate + Reset)
   ============================================ */
.action-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.action-row .generate-btn {
    flex: 3;
    padding: 18px 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.30);
}

.action-row .generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.40);
}

.action-row .generate-btn:active {
    transform: translateY(0px);
}

.action-row .generate-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.action-row .generate-btn:hover i {
    transform: rotate(20deg) scale(1.1);
}

.action-row .generate-btn.loading i {
    animation: spin 0.8s linear infinite;
}

.action-row .reset-btn {
    flex: 1;
    padding: 18px 24px;
    background: #f1f4ff;
    color: #4b5563;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 110px;
}

.action-row .reset-btn:hover {
    background: #e8edf9;
    border-color: #6366f1;
    color: #6366f1;
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.10);
}

.action-row .reset-btn:active {
    transform: translateY(0px);
}

.action-row .reset-btn i {
    font-size: 0.95rem;
    color: #6366f1;
}

.action-row .reset-btn:hover i {
    color: #6366f1;
}

.action-row .reset-btn.loading i {
    animation: spin 0.6s ease-in-out;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESULTS
   ============================================ */
.results {
    min-height: 80px;
    transition: all 0.3s ease;
}

.results-empty {
    text-align: center;
    padding: 40px 16px;
    color: #9ca3af;
}

.results-empty i {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 12px;
    color: #d1d5db;
}

.results-empty p {
    font-size: 0.95rem;
}

/* Name List */
.name-list {
    display: grid;
    gap: 10px;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.name-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8faff;
    border-radius: 12px;
    border: 1px solid #e8edf9;
    transition: all 0.2s ease;
    animation: slideItem 0.3s ease backwards;
}

.name-item:hover {
    background: #f0f4ff;
    border-color: #6366f1;
    transform: translateX(4px);
}

.name-item .name-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: #1a1a2e;
}

.name-item .name-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 14px;
    border-radius: 20px;
    background: #e5e7eb;
    color: #6b7280;
}

.name-item .name-badge.fantasy {
    background: #ede9fe;
    color: #7c3aed;
}
.name-item .name-badge.sci-fi {
    background: #dbeafe;
    color: #2563eb;
}
.name-item .name-badge.historical {
    background: #fef3c7;
    color: #b45309;
}
.name-item .name-badge.modern {
    background: #d1fae5;
    color: #059669;
}
.name-item .name-badge.nature {
    background: #d1fae5;
    color: #166534;
}
.name-item .name-badge.cyber {
    background: #fce4ec;
    color: #c62828;
}

.name-item .name-copy {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.name-item .name-copy:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

@keyframes slideItem {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.name-item:nth-child(1) { animation-delay: 0.02s; }
.name-item:nth-child(2) { animation-delay: 0.06s; }
.name-item:nth-child(3) { animation-delay: 0.10s; }
.name-item:nth-child(4) { animation-delay: 0.14s; }
.name-item:nth-child(5) { animation-delay: 0.18s; }
.name-item:nth-child(6) { animation-delay: 0.22s; }
.name-item:nth-child(7) { animation-delay: 0.26s; }
.name-item:nth-child(8) { animation-delay: 0.30s; }
.name-item:nth-child(9) { animation-delay: 0.34s; }
.name-item:nth-child(10) { animation-delay: 0.38s; }
.name-item:nth-child(11) { animation-delay: 0.42s; }
.name-item:nth-child(12) { animation-delay: 0.46s; }
.name-item:nth-child(13) { animation-delay: 0.50s; }
.name-item:nth-child(14) { animation-delay: 0.54s; }
.name-item:nth-child(15) { animation-delay: 0.58s; }
.name-item:nth-child(16) { animation-delay: 0.62s; }
.name-item:nth-child(17) { animation-delay: 0.66s; }
.name-item:nth-child(18) { animation-delay: 0.70s; }
.name-item:nth-child(19) { animation-delay: 0.74s; }
.name-item:nth-child(20) { animation-delay: 0.78s; }

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a2e;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.20);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast i {
    font-size: 1.1rem;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    text-align: center;
    margin-top: 28px;
    color: #9ca3af;
    font-size: 0.85rem;
}

footer p {
    margin-bottom: 6px;
}

footer kbd {
    display: inline-block;
    padding: 3px 12px;
    background: #eef2f6;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    color: #4b5563;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    font-size: 0.8rem;
}

.footer-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-stats i {
    color: #6366f1;
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .generator-card {
        padding: 24px 18px 20px;
        border-radius: 18px;
    }

    .controls {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .control-group:last-child {
        grid-column: 1 / -1;
    }

    .name-display {
        padding: 20px 16px;
        min-height: 70px;
    }

    .generated-name {
        font-size: 1.5rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo i {
        font-size: 1.4rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    .action-row {
        flex-direction: column;
    }

    .action-row .reset-btn {
        min-width: auto;
        padding: 14px 20px;
    }

    .action-row .generate-btn {
        padding: 16px 24px;
        font-size: 0.95rem;
    }

    .footer-stats {
        flex-direction: column;
        gap: 4px;
    }

    .name-item {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .name-item .name-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 420px) {
    .controls {
        grid-template-columns: 1fr;
    }

    .control-group:last-child {
        grid-column: 1;
    }

    .generated-name {
        font-size: 1.2rem;
    }

    .name-display {
        padding: 16px 12px;
        min-height: 60px;
    }
}