/* Custom styles for NutifAI */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
}

.feature-badge {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.upload-area.drag-over {
    border-color: var(--bs-success);
    background-color: rgba(var(--bs-success-rgb), 0.1);
}

.upload-content {
    pointer-events: none;
}

/* Processing Steps */
.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--bs-gray-100);
    transition: all 0.3s ease;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bs-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.25rem;
    color: var(--bs-gray-600);
    transition: all 0.3s ease;
}

.step-content {
    flex-grow: 1;
}

.step-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-description {
    color: var(--bs-gray-600);
    font-size: 0.875rem;
}

.step.active {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-left: 4px solid var(--bs-primary);
}

.step.active .step-icon {
    background: var(--bs-primary);
    color: white;
    animation: pulse 2s infinite;
}

.step.completed {
    background: rgba(var(--bs-success-rgb), 0.1);
    border-left: 4px solid var(--bs-success);
}

.step.completed .step-icon {
    background: var(--bs-success);
    color: white;
}

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

/* Analysis Items */
.analysis-item {
    text-align: center;
    padding: 1rem;
    background: var(--bs-gray-100);
    border-radius: 0.5rem;
}

.analysis-label {
    font-size: 0.875rem;
    color: var(--bs-gray-600);
    margin-bottom: 0.5rem;
}

.analysis-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-primary);
}

/* Instrument Cards */
.instrument-card {
    background: var(--bs-gray-100);
    border: 2px solid transparent;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.instrument-card:hover {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
}

.instrument-card .form-check-input:checked ~ .form-check-label .instrument-card {
    border-color: var(--bs-success);
    background: rgba(var(--bs-success-rgb), 0.1);
}

.confidence-badge {
    background: var(--bs-info);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.instrument-result-card {
    background: var(--bs-gray-100);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--bs-primary);
}

/* Success Icon */
.success-icon {
    font-size: 4rem;
    color: var(--bs-success);
}

/* Download Cards */
.download-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-card-header {
    padding: 1rem;
    display: flex;
    align-items: center;
}

.file-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-type {
    font-size: 0.875rem;
    color: var(--bs-gray-600);
}

.download-card-footer {
    padding: 0 1rem 1rem;
}

/* Audio Player Placeholder */
.audio-player-container {
    background: var(--bs-gray-100);
    border-radius: 0.5rem;
    overflow: hidden;
}

.audio-placeholder {
    padding: 2rem;
    text-align: center;
    color: var(--bs-gray-600);
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 1rem 0;
    }
    
    .feature-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .progress-steps .step {
        flex-direction: column;
        text-align: center;
    }
    
    .progress-steps .step-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .analysis-item,
[data-bs-theme="dark"] .instrument-card,
[data-bs-theme="dark"] .instrument-result-card {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] .upload-area {
    background: var(--bs-gray-900);
}

[data-bs-theme="dark"] .step {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] .audio-placeholder {
    background: var(--bs-gray-800);
}

/* Loading animations */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

/* Status badges */
.status-badge .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Chart containers */
canvas {
    max-height: 300px !important;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Additional styles for enhanced result page */
.audio-player-container audio {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    outline: none;
    background: white;
}

.audio-player-container audio::-webkit-media-controls-panel {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.analysis-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid #6f42c1;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.analysis-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(111, 66, 193, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin: 0.25rem 0;
    line-height: 1.2;
}

.stat-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Enhanced instrument cards */
.instrument-result-card {
    padding: 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.instrument-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(111, 66, 193, 0.2);
    border-color: #6f42c1;
}

.confidence-badge {
    background: linear-gradient(135deg, #6f42c1, #8b5cf6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

/* Audio player enhancements */
.audio-player-container {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.audio-player-container .btn {
    transition: all 0.2s ease;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.audio-player-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Download cards enhancements */
.download-card {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #6f42c1;
}

.download-card-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.file-icon {
    font-size: 2.5rem;
    min-width: 50px;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 700;
    color: #212529;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.file-type {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

.download-card-footer {
    padding: 1rem 1.25rem;
    background: white;
    border-top: 1px solid #e9ecef;
}

/* Success icon animation */
@keyframes scaleIn {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-icon {
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Lyrics Display Styling */
.lyrics-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lyrics-header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: #e94560;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.lyrics-header i {
    color: #e94560;
    font-size: 1.2rem;
}

.lyrics-body {
    padding: 2rem;
    max-height: 600px;
    overflow-y: auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.lyrics-body::-webkit-scrollbar {
    width: 8px;
}

.lyrics-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.lyrics-body::-webkit-scrollbar-thumb {
    background: rgba(233, 69, 96, 0.5);
    border-radius: 4px;
}

.lyrics-body::-webkit-scrollbar-thumb:hover {
    background: rgba(233, 69, 96, 0.7);
}

.lyrics-line {
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1.8;
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.lyrics-line:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #e94560;
    padding-left: 1rem;
}

.lyrics-break {
    height: 1rem;
}

.lyrics-line-number {
    min-width: 2.5rem;
    text-align: center;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lyrics-line-text {
    white-space: pre-wrap;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Dark theme adjustments for lyrics */
[data-bs-theme="dark"] .lyrics-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Utility helpers for CSP-safe layouts */
.hidden-section {
    display: none !important;
}

.auth-layout {
    margin-left: auto;
    margin-right: auto;
}

.auth-layout-sm {
    max-width: 480px;
}

.auth-layout-md {
    max-width: 540px;
}

.auth-layout-lg {
    max-width: 560px;
}

.audio-player {
    width: 100%;
    max-width: 600px;
}

.cursor-pointer {
    cursor: pointer;
}

.truncate-cell {
    max-width: 240px;
}

.mfa-qr-code {
    width: 220px;
    height: 220px;
    background: #fff;
}

.visualization-video {
    width: 100%;
    height: auto;
}


/* Error Pages */
.error-page {
    position: relative;
    overflow: hidden;
}

.error-page .container {
    position: relative;
    z-index: 2;
}

.error-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), 0.15);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.35);
    backdrop-filter: blur(6px);
}

.error-code {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
}

.error-label {
    font-size: 0.875rem;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.error-actions .btn {
    min-width: 200px;
    box-shadow: 0 0.75rem 1.5rem rgba(13, 110, 253, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.error-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 1.25rem 2rem rgba(13, 110, 253, 0.2);
}

.error-visual {
    position: relative;
}

.error-orb {
    width: clamp(220px, 40vw, 320px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(3rem, 5vw, 4.5rem);
    color: #fff;
    background: radial-gradient(circle at 30% 30%, rgba(13, 110, 253, 0.9), rgba(111, 66, 193, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2rem 4rem rgba(13, 110, 253, 0.2);
}

.error-wave {
    position: absolute;
    inset: auto 10% 20% 10%;
    height: clamp(140px, 18vw, 220px);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15), rgba(111, 66, 193, 0.1));
    border-radius: 2rem;
    filter: blur(24px);
}

.error-gradient {
    position: absolute;
    top: -20%;
    right: -25%;
    width: 45%;
    height: 65%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.35) 0%, rgba(13, 110, 253, 0) 70%);
    z-index: 0;
}

.error-glow {
    position: absolute;
    bottom: -10%;
    left: -15%;
    width: 40%;
    height: 50%;
    background: radial-gradient(circle, rgba(111, 66, 193, 0.35) 0%, rgba(111, 66, 193, 0) 70%);
    z-index: 0;
}

@media (max-width: 767.98px) {
    .error-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .error-wave {
        inset: auto 0 15% 0;
    }
}
