* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ec4899;
    --primary-dark: #db2777;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f9fafb;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.header-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-back-btn:active {
    transform: translateY(0);
}

.header-back-btn span:first-child {
    font-size: 1.2rem;
}

.ai-model-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.model-icon {
    font-size: 1.2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.model-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex: 1;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.powered-by {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.15);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.powered-icon {
    font-size: 1.3rem;
    animation: pulse 2s ease-in-out infinite;
}

.powered-by strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Music Generator */
.music-generator {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.music-generator h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

/* Form */
.music-form {
    max-width: 900px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
}

.label-icon {
    margin-right: 0.3rem;
}

.label-text {
    font-size: 1rem;
}

.label-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
}

textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.select-input,
.text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Advanced Options */
.advanced-toggle {
    text-align: center;
    margin: 2rem 0;
}

.toggle-btn {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.advanced-options {
    margin-top: 1.5rem;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 1rem;
    border: 2px dashed var(--border-color);
}

/* Primary Button */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Examples */
.examples-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.examples-section h4 {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.example-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.example-btn {
    background: white;
    border: 2px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.example-btn:hover {
    border-color: var(--primary-color);
    background: #fdf2f8;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 1rem;
    margin-top: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error Box */
.error-box {
    padding: 1.5rem;
    background: #fef2f2;
    border: 2px solid var(--error-color);
    border-radius: 1rem;
    color: var(--error-color);
    margin-top: 2rem;
    text-align: center;
    font-weight: 600;
}

/* Result Box */
.result-box {
    margin-top: 3rem;
    padding: 2.5rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--primary-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.result-header h3 {
    font-size: 1.8rem;
    color: var(--text-color);
}

.copy-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.result-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.result-content h4 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.result-content p {
    margin-bottom: 1rem;
}

.result-content strong {
    color: var(--text-color);
    font-weight: 700;
}

.music-tools {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 1rem;
}

.music-tools h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

.tool-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.tool-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.2s ease;
}

.tool-link:hover {
    border-color: var(--primary-color);
    background: #fdf2f8;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

/* Back to Home Button (Floating) */
.back-to-home-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 2px solid rgba(236, 72, 153, 0.5);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
}

.back-to-home-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-home-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.6);
    background: linear-gradient(135deg, var(--primary-dark), #7c3aed);
}

.back-to-home-btn:active {
    transform: translateY(-2px);
}

.back-to-home-btn span {
    display: block;
    line-height: 1;
}

a{
    text-decoration: none;
}
/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    .music-generator {
        padding: 2rem 1.5rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .powered-by {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }

    .ai-model-badge {
        display: none;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .example-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .tool-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .result-header {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        flex-direction: column-reverse;
        width: 100%;
    }

    .header-back-btn {
        width: 100%;
        justify-content: center;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .example-buttons {
        grid-template-columns: 1fr;
    }
}