/* ============================================
   JMUSIC - CSS STYLESHEET
   ============================================ */

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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 40px 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    margin-bottom: 40px;
}

.header-top {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.language-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    font-weight: 600;
}

.header-content {
    text-align: center;
}

.header-content h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    text-align: center;
    margin-bottom: 50px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ============================================
   PRICING SECTION
   ============================================ */

.pricing-section {
    margin-bottom: 60px;
    text-align: center;
}

.pricing-section h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.pricing-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.2);
}

.pricing-card.featured {
    border-color: var(--secondary-color);
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(236, 72, 153, 0.2);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 60px rgba(236, 72, 153, 0.3);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pricing-badge.featured {
    background: var(--secondary-color);
}

.pricing-card h4 {
    font-size: 1.5rem;
    margin-top: 15px;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.pricing-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.currency {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.price {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-primary);
}

.price-unit {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pricing-description {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.pricing-savings {
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.btn-purchase {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn-purchase.featured {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #d1367a 100%);
}

.btn-purchase.featured:hover {
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
}

/* ============================================
   GENERATOR SECTION
   ============================================ */

.generator-section {
    margin-bottom: 60px;
}

.generator-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.generator-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.2);
}

.generator-card h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-light);
}

.user-info {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #86efac;
}

/* ============================================
   FORM STYLES
   ============================================ */

.music-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group textarea {
    width: 100%;
    padding: 15px;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-generate {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn-generate:active:not(:disabled) {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text {
    display: inline;
}

.btn-loader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px 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); }
}

.btn-download,
.btn-new,
.btn-retry,
.btn-payment {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download {
    background: var(--success-color);
    color: white;
    flex: 1;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-new {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-new:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-retry {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-retry:hover {
    background: var(--primary-dark);
}

.btn-payment {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #d1367a 100%);
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-payment:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
}

/* ============================================
   STATES
   ============================================ */

.loading-state {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.error-state {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.error-state p {
    color: #fca5a5;
    margin-bottom: 15px;
}

.success-state {
    animation: slideIn 0.3s ease;
}

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

.success-state h4 {
    color: var(--success-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.music-info {
    background: var(--surface-light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.music-info p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.music-info strong {
    color: var(--primary-light);
}

/* ============================================
   AUDIO PLAYER
   ============================================ */

.audio-player {
    margin: 25px 0;
    background: var(--surface-light);
    border-radius: 10px;
    padding: 15px;
}

audio {
    width: 100%;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: var(--surface-light);
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
    display: flex;
    gap: 15px;
}

@media (max-width: 600px) {
    .action-buttons {
        flex-direction: column;
    }

    .btn-download,
    .btn-new {
        flex: none;
        width: 100%;
    }
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
    margin: 60px 0;
    text-align: center;
}

.features h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.2);
}

.feature-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-light);
}

.feature-card p {
    color: var(--text-secondary);
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--primary-light);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-primary);
}

.payment-summary {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
}

.payment-summary p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.payment-summary strong {
    color: var(--primary-light);
}

#stripe-element {
    margin-bottom: 20px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    color: var(--text-secondary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.legal-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.legal-links a {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.legal-links a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.legal-links .separator {
    color: var(--border-color);
    margin: 0 5px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2.5rem;
    }

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

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

    .pricing-card.featured {
        transform: scale(1);
    }

    .pricing-card.featured:hover {
        transform: translateY(-5px);
    }

    .generator-card {
        padding: 25px;
    }

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

@media (max-width: 480px) {
    .header {
        padding: 30px 20px;
        margin-bottom: 30px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .language-selector {
        gap: 5px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

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

    .pricing-section h3 {
        font-size: 1.8rem;
    }

    .pricing-card {
        padding: 20px;
    }

    .pricing-card h4 {
        font-size: 1.3rem;
    }

    .price {
        font-size: 2.5rem;
    }

    .generator-card {
        padding: 20px;
    }

    .generator-card h3 {
        font-size: 1.5rem;
    }

    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }

    .btn-generate {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .modal-content {
        padding: 25px;
    }
}
