:root {
    --primary: #ff4141;
    --primary-dark: #d93636;
    --secondary: #ff6b00;
    --accent: #ffa500;
    --success: #00ff88;
    --warning: #ffd700;
    --error: #ff1744;
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #252525;
    --border: #2a2a2a;
    --border-glow: #ff4141;
    --text: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #808080;
    --shadow: 0 4px 12px rgba(255, 65, 65, 0.2);
    --shadow-lg: 0 10px 30px rgba(255, 65, 65, 0.4);
    --glow: 0 0 20px rgba(255, 65, 65, 0.5);
    --radius: 12px;
    --radius-lg: 16px;
}

h1.entry-title {
    font-size: 22px;
    color: var(--text);
}

/* Main layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Control panel wrapper - Free Fire gradient border */
.control-panel-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 3px;
    background: linear-gradient(135deg, 
        #ff4141 0%, 
        #ff6b00 25%, 
        #ffa500 50%, 
        #ff6b00 75%, 
        #ff4141 100%
    );
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
    box-shadow: 
        0 0 30px rgba(255, 65, 65, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.control-panel-wrapper:hover {
    box-shadow: 
        0 0 40px rgba(255, 65, 65, 0.6),
        0 6px 30px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Control panel */
.control-panel {
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: calc(var(--radius-lg) - 3px);
    padding: 28px;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-panel form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Main text input */
.input-group:has(#textInput) {
    width: 100%;
    margin-bottom: 8px;
}

.input-group:has(#textInput) input {
    width: 100%;
    padding: 18px 24px;
    font-size: 16px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    transition: all 0.3s ease;
    font-weight: 500;
}

.input-group:has(#textInput) input:focus {
    border-color: var(--primary);
    box-shadow: 
        0 0 0 3px rgba(255, 65, 65, 0.2),
        0 0 20px rgba(255, 65, 65, 0.3);
    background: #202020;
    transform: translateY(-1px);
}

.input-group:has(#textInput) input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Horizontal select group */
.select-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 8px;
}

.input-group {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    color: var(--accent);
    font-size: 12px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: #202020;
    box-shadow: 0 0 0 2px rgba(255, 65, 65, 0.15);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg width='12' height='12' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 6L8 10L12 6' stroke='%23ff4141' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    text-align: center;
    font-weight: 500;
}

.input-group select:hover {
    border-color: var(--secondary);
}

/* Generate button - Free Fire style */
.generate-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #ff4141 0%, #ff6b00 50%, #ffa500 100%);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(255, 65, 65, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: gradientShift 4s ease infinite;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 
        0 6px 25px rgba(255, 65, 65, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 30px rgba(255, 107, 0, 0.4);
}

.generate-btn:hover:not(:disabled)::before {
    left: 100%;
}

.generate-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading in control panel */
.control-panel .loading-state {
    display: none;
    text-align: center;
    padding: 16px;
    color: var(--accent);
}

.control-panel .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
    box-shadow: 0 0 10px rgba(255, 65, 65, 0.3);
}

.control-panel.loading .loading-state {
    display: block;
}

.control-panel.loading .generate-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error message */
.error-message {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid var(--error);
    color: #ff6b6b;
    padding: 14px;
    border-radius: var(--radius);
    display: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

/* Results section */
.results-section {
    background: transparent;
    display: none;
}

.results-section.visible {
    display: block;
}

/* Loading state */
.loading-state {
    display: none;
    text-align: center;
    padding: 80px 20px;
    color: var(--accent);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
    box-shadow: 0 0 15px rgba(255, 65, 65, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Nickname grid */
.nickname-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.nickname-item {
    background: linear-gradient(145deg, #1a1a1a 0%, #151515 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nickname-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 65, 65, 0.1), transparent);
    transition: left 0.5s;
}

.nickname-item:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 
        0 8px 20px rgba(255, 65, 65, 0.3),
        0 0 20px rgba(255, 65, 65, 0.2);
    background: linear-gradient(145deg, #202020 0%, #1a1a1a 100%);
}

.nickname-item:hover::before {
    left: 100%;
}

.nickname-text {
    font-size: 17px;
    color: var(--text);
    margin-bottom: 8px;
    word-break: break-all;
    line-height: 1.5;
    font-weight: 500;
}

.nickname-label {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 20px;
    padding: 5px 14px;
    display: inline-block;
}

.copy-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #00cc70);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.nickname-item:hover .copy-indicator {
    opacity: 1;
    transform: scale(1);
}

/* Suggestions */
.suggestions-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.suggestions-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff4141, #ff6b00);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 65, 65, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(255, 65, 65, 0.5),
        0 0 20px rgba(255, 107, 0, 0.4);
    background: linear-gradient(135deg, #ff5252, #ff7b10);
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #00ff88, #00cc70);
    color: #000;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 
        0 4px 20px rgba(0, 255, 136, 0.4),
        0 0 20px rgba(0, 255, 136, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(0);
}

/* Animation */
.nickname-item {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    
    .control-panel-wrapper {
        padding: 2px;
    }
    
    .control-panel {
        padding: 24px 18px;
    }
    
    .select-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .nickname-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .input-group:has(#textInput) input {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .generate-btn {
        font-size: 16px;
        padding: 16px 22px;
    }
}

@media (max-width: 480px) {
    .generate-btn {
        padding: 15px 20px;
        font-size: 15px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        font-size: 13px;
    }
    
    .control-panel {
        padding: 20px 16px;
    }
}