/* static/css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
}

/* Piano keyboard specific styles */
.piano-keyboard {
    user-select: none;
    touch-action: manipulation;
}

.piano-key {
    position: relative;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom;
}

.piano-key:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.piano-key:active,
.piano-key.playing {
    transform: translateY(2px) scale(0.98);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.2);
}

.white-key {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid var(--gray-300);
    border-radius: 0 0 8px 8px;
}

.black-key {
    background: linear-gradient(to bottom, #2d3748 0%, #1a202c 100%);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Loading animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Chart container styles */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Audio player customization */
audio {
    width: 100%;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: var(--gray-100);
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive design helpers */
@media (max-width: 768px) {
    .piano-keyboard {
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .piano-key {
        min-width: 30px;
        height: 100px;
    }
    
    .black-key {
        min-width: 18px;
        height: 65px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #60a5fa;
        --secondary-color: #a78bfa;
    }
}

.piano-key.playing.white-key {
    background: linear-gradient(to bottom, #e0e0e0 0%, #d0d0d0 100%); /* Darker white */
    transform: translateY(1px) scale(0.99);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}

.piano-key.playing.black-key {
    background: linear-gradient(to bottom, #1a202c 0%, #000000 100%); /* Darker black */
    transform: translateY(1px) scale(0.99);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.4);
}

.text-xxs {
    font-size: 0.65rem; /* Extra extra small text */
    line-height: 0.85rem;
}

/* Ensure keyboard container allows for black keys to overlap correctly */
.piano-keyboard-container .flex {
    align-items: flex-start; /* Align white keys to the top */
}