:root {
    --primary: #e91e63;
    --primary-dark: #c2185b;
    --primary-light: #f8bbd0;
    --secondary: #ff6b35;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --bg: #fff5f5;
    --bg-card: #ffffff;
    --bg-input: #fafafa;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border: #ffe0e0;
    --text: #2c2c2c;
    --text-secondary: #666666;
    --text-muted: #999999;
    --shadow: 0 2px 8px rgba(233, 30, 99, 0.1);
    --shadow-lg: 0 8px 24px rgba(233, 30, 99, 0.15);
    --shadow-hover: 0 12px 32px rgba(233, 30, 99, 0.2);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main layout */
.main-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 32px;
    align-items: start;
    padding: 20px 0;
}

/* Control panel */
.control-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    position: sticky;
    top: 20px;
    transition: var(--transition);
}

.control-panel:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.panel-header {
    margin-bottom: 24px;
    text-align: center;
}

.panel-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.decorations-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin: 20px 0;
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group {
    margin-bottom: 18px;
}

.input-group:last-of-type {
    margin-bottom: 0;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
}

.label-icon {
    font-size: 16px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.1);
    transform: translateY(-1px);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg width='14' height='14' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 6L8 10L12 6' stroke='%23e91e63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

/* Generate button */
.generate-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px 0 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.3);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.4);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn-icon {
    font-size: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Tips box */
.tips-box {
    background: linear-gradient(135deg, #fff9e6, #ffe0b2);
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 16px;
}

.tips-title {
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
    font-size: 13px;
}

.tips-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

kbd {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 12px;
    box-shadow: 0 2px 0 #ddd;
color:#212529;
}

/* Loading state */
.loading-state {
    display: none;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.control-panel.loading .loading-state {
    display: block;
}

.control-panel.loading .generate-btn {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Error message */
.error-message {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 2px solid var(--error);
    color: #c62828;
    padding: 14px 16px;
    border-radius: var(--radius);
    display: none;
    font-size: 14px;
    font-weight: 600;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Results section */
.results-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    padding: 32px;
    display: none;
    box-shadow: var(--shadow-lg);
}

.results-section.visible {
    display: block;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.results-header {
    text-align: center;
    margin-bottom: 28px;
}

.results-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.results-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Nickname grid */
.nickname-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.nickname-item {
    background: linear-gradient(135deg, #ffffff, #fafafa);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nickname-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nickname-item:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    background: white;
}

.nickname-item:hover::before {
    transform: scaleX(1);
}

.nickname-text {
    color: var(--text);
    margin-bottom: 8px;
    word-break: break-all;
    line-height: 1.5;
    font-size: 16px;
    font-weight: 600;
}

.nickname-label {
    font-size: 11px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    padding: 4px 12px;
    display: inline-block;
}

.copy-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.nickname-item:hover .copy-indicator {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Suggestions */
.suggestions-section {
    margin-top: 32px;
}

.suggestions-divider {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.suggestions-divider::before,
.suggestions-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.suggestions-divider::before {
    left: 0;
}

.suggestions-divider::after {
    right: 0;
}

.suggestions-divider span {
    background: var(--bg-card);
    padding: 0 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.suggestions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--secondary), #ff8c42);
    color: white;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.suggestions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
}

.btn-icon-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.suggestions-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Toast notification */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--success), #66bb6a);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 20px;
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% { transform: scale(0) rotate(-45deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}

/* Animations */
.nickname-item {
    animation: fadeInUp 0.4s ease forwards;
}

.nickname-item:nth-child(1) { animation-delay: 0.05s; }
.nickname-item:nth-child(2) { animation-delay: 0.1s; }
.nickname-item:nth-child(3) { animation-delay: 0.15s; }
.nickname-item:nth-child(4) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 380px 1fr;
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .control-panel {
        position: static;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .control-panel,
    .results-section {
        padding: 20px;
    }

    .nickname-grid {
        grid-template-columns: 1fr;
    }

    .panel-title {
        font-size: 20px;
    }

    .results-title {
        font-size: 24px;
    }
}