/* Music Generation Studio - Professional Styles */

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f3f4f6;
}

* {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 50%, #f0f4f8 100%);
    color: var(--dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

body.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #f3f4f6;
}

/* Navbar */
.navbar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-theme .card {
    background: #374151;
    color: #f3f4f6;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.card-header {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%) !important;
    border-radius: 12px 12px 0 0 !important;
    border: none !important;
    padding: 1.25rem !important;
}

body.dark-theme .card-header {
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%) !important;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(90deg, var(--success) 0%, #059669 100%);
}

.btn-success:hover {
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(90deg, var(--warning) 0%, #d97706 100%);
}

.btn-danger {
    background: linear-gradient(90deg, var(--danger) 0%, #dc2626 100%);
}

.btn-info {
    background: linear-gradient(90deg, var(--info) 0%, #2563eb 100%);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    transition: all 0.3s ease;
}

body.dark-theme .form-control {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border-color: #6b7280;
    color: #f3f4f6;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}

body.dark-theme .form-control:focus {
    background: linear-gradient(135deg, #4b5563 0%, #4f46e5 100%);
}

/* Range Slider Styling */
.form-range {
    height: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 100%);
    border: 2px solid #d1d5db;
    padding: 0;
    outline: none;
}

body.dark-theme .form-range {
    background: linear-gradient(90deg, #4b5563 0%, #374151 100%);
    border-color: #6b7280;
}

/* Range track styling */
.form-range::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    height: 0.75rem;
    border-radius: 8px;
    border: none;
}

.form-range::-moz-range-track {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    height: 0.75rem;
    border-radius: 8px;
    border: none;
}

body.dark-theme .form-range::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
}

body.dark-theme .form-range::-moz-range-track {
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
}

/* Slider thumb styling */
.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.7);
}

.form-range::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.7);
}

.form-range::-moz-range-thumb:active {
    transform: scale(1.1);
}

body.dark-theme .form-range::-webkit-slider-thumb {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.6);
}

body.dark-theme .form-range::-webkit-slider-thumb:hover {
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.8);
}

body.dark-theme .form-range::-moz-range-thumb {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.6);
}

body.dark-theme .form-range::-moz-range-thumb:hover {
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.8);
}

/* Labels */
.form-label {
    color: var(--dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-theme .form-label {
    color: #e5e7eb;
}

/* Textarea styling */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

textarea.form-control:focus {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}

body.dark-theme textarea.form-control:focus {
    background: linear-gradient(135deg, #4b5563 0%, #4f46e5 100%);
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
}

/* Music Display */
#musicDisplay {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #1f2937 !important;
    color: #10b981 !important;
    border-radius: 8px;
}

body.dark-theme #musicDisplay {
    background: #0f172a !important;
    color: #4ade80 !important;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem;
    animation: slideIn 0.3s ease;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

body.dark-theme .alert-danger {
    background: #7f1d1d;
    color: #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

body.dark-theme .alert-info {
    background: #1e3a8a;
    color: #93c5fd;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* History List */
.history-item {
    cursor: pointer;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.history-item:hover {
    background: #f0f9ff;
    border-left-color: var(--primary);
}

body.dark-theme .history-item:hover {
    background: #1e3a8a;
}

.history-item.active {
    background: #dbeafe;
    border-left-color: var(--primary);
}

body.dark-theme .history-item.active {
    background: #1e3a8a;
}

/* Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Responsive */
@media (max-width: 992px) {
    .sticky-lg-top {
        position: static !important;
    }

    .btn-lg {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    #musicDisplay {
        font-size: 0.85rem;
        max-height: 200px !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
}

/* Footer */
footer {
    background: linear-gradient(90deg, var(--dark) 0%, #111827 100%);
    border-top: 2px solid var(--primary);
}
