/* Fantasy Name Generator - Modern Professional UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

.fng-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Home Page Container */
.fng-home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header - Modern Typography */
.fng-header {
    margin-bottom: 48px;
    text-align: left;
}

.fng-header h1 {
    font-size: 2.5rem;
    color: #0f172a;
    margin: 0 0 12px 0;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.fng-header p {
    font-size: 1.125rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Category Section */
.fng-category-section {
    margin-bottom: 56px;
}

.fng-category-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.fng-category-header > div {
    flex: 1;
}

.fng-category-header h2 {
    font-size: 1.75rem;
    color: #8b5cf6;
    margin: 0 0 8px 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.fng-category-header p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.fng-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: #8b5cf6;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fng-view-all-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.fng-view-all-btn svg {
    transition: transform 0.2s ease;
}

.fng-view-all-btn:hover svg {
    transform: translateX(2px);
}

/* Home Grid - 4 Column Layout */
.fng-home-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Home Card - Gradient Background with Overlay */
.fng-home-card {
    position: relative;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Different gradient for each card */
.fng-home-card:nth-child(8n+1) { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.fng-home-card:nth-child(8n+2) { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.fng-home-card:nth-child(8n+3) { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.fng-home-card:nth-child(8n+4) { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.fng-home-card:nth-child(8n+5) { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.fng-home-card:nth-child(8n+6) { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.fng-home-card:nth-child(8n+7) { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.fng-home-card:nth-child(8n+8) { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }

.fng-home-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
    transition: background 0.3s ease;
}

.fng-home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.fng-home-card:hover::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
}

.fng-home-card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #ffffff;
}

.fng-home-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #ffffff;
    line-height: 1.3;
}

.fng-home-card p {
    font-size: 0.9375rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.fng-home-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.fng-home-card:hover .fng-home-arrow {
    transform: translateX(4px);
    color: rgba(255, 255, 255, 1);
}

/* Old category styles (keep for compatibility) */
.fng-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.fng-category-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fng-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
    border-color: #a78bfa;
}

.fng-category-card h3 {
    color: #8b5cf6;
    font-size: 1.25rem;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.fng-category-card p {
    color: #64748b;
    font-size: 0.9375rem;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.fng-generator-count {
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Generators Grid */
.fng-generators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.fng-generator-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fng-generator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
    border-color: #a78bfa;
}

.fng-generator-card h3 {
    color: #8b5cf6;
    font-size: 1.125rem;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.fng-generator-card p {
    color: #64748b;
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.5;
}

/* Generator Controls - Modern Card */
.fng-generator-controls {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Gender Selector */
.fng-gender-selector h3 {
    font-size: 0.8125rem;
    color: #0f172a;
    margin: 0 0 12px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fng-gender-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.fng-gender-btn {
    padding: 12px 20px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.fng-gender-btn:hover {
    border-color: #a78bfa;
    background: #faf5ff;
    color: #7c3aed;
}

.fng-gender-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Generate Button - Modern Gradient */
.fng-generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.fng-generate-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
}

.fng-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.fng-generate-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.fng-icon {
    font-size: 1.125rem;
}

/* Advanced Options - Clean Toggle */
.fng-advanced-options {
    margin-top: 16px;
}

.fng-toggle-advanced {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.fng-toggle-advanced:hover {
    color: #8b5cf6;
}

.fng-advanced-content {
    margin-top: 20px;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.fng-advanced-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.fng-advanced-row:last-child {
    margin-bottom: 0;
}

.fng-option-group label {
    display: block;
    font-size: 0.8125rem;
    color: #334155;
    margin-bottom: 8px;
    font-weight: 600;
}

.fng-option-group select,
.fng-option-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

.fng-option-group select:focus,
.fng-option-group input[type="text"]:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Loading State */
.fng-loading {
    text-align: center;
    padding: 60px 20px;
}

.fng-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fng-loading p {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
}

/* Results Container - Full Width Vertical Stack */
.fng-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 28px;
}

/* Name Card - Clean Horizontal Layout (Name on Left, Copy on Right) */
.fng-name-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fng-name-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Name Info Section (Left Side) */
.fng-name-info {
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

.fng-name-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Name Details - Meaning and Etymology */
.fng-name-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fng-name-meaning,
.fng-name-etymology {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.35;
}

.fng-label {
    font-weight: 400;
    color: #94a3b8;
}

/* Copy Button - Icon Only */
.fng-copy-btn {
    flex-shrink: 0;
    padding: 8px;
    background: transparent;
    border: none;
    color: #8651f3;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-start;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fng-copy-btn:hover {
    background: rgba(134, 81, 243, 0.1);
    color: #8651f3;
}

.fng-copy-btn.copied {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Copy Notification Popup */
.fng-copy-notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
}

.fng-copy-notification.show {
    bottom: 30px;
}

.fng-copy-notification svg {
    color: #10b981;
}

.fng-copy-notification span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

@media (max-width: 768px) {
    .fng-copy-notification span {
        max-width: 250px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .fng-home-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .fng-home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .fng-container {
        padding: 16px;
    }
    
    .fng-home-container {
        padding: 24px 16px;
    }
    
    .fng-header h1 {
        font-size: 1.75rem;
    }
    
    .fng-header p {
        font-size: 0.9375rem;
    }
    
    .fng-home-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .fng-home-card {
        height: 160px;
    }
    
    .fng-categories-grid,
    .fng-generators-grid {
        grid-template-columns: 1fr;
    }
    
    .fng-gender-buttons {
        grid-template-columns: 1fr;
    }
    
    .fng-advanced-row {
        grid-template-columns: 1fr;
    }
    
    .fng-name-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fng-copy-btn {
        align-self: stretch;
        text-align: center;
    }
    
    .fng-name-title {
        font-size: 1rem;
    }
    
    .fng-category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fng-view-all-btn {
        margin-top: 8px;
        align-self: flex-start;
    }
}
