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

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #37352f;
    background: #ffffff;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9e9e7;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2f3437;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #787774;
    font-weight: 400;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Section styles */
section {
    background: #ffffff;
    border: 1px solid #e9e9e7;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2f3437;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Textarea styles */
#lyrics-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e9e9e7;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: #fafafa;
}

#lyrics-input:focus {
    outline: none;
    border-color: #2383e2;
    background: #ffffff;
}

#lyrics-input::placeholder {
    color: #9b9a97;
    font-style: italic;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn.primary {
    background: #2383e2;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: #1a73d1;
    transform: translateY(-1px);
}

.btn.secondary {
    background: #f1f1ef;
    color: #37352f;
    border: 1px solid #e9e9e7;
}

.btn.secondary:hover:not(:disabled) {
    background: #e9e9e7;
    transform: translateY(-1px);
}

.btn.success {
    background: #0f7b0f;
    color: white;
}

.btn.success:hover:not(:disabled) {
    background: #0d6b0d;
    transform: translateY(-1px);
}

/* Controls layout */
.controls, .color-controls, .timing-controls, .preview-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Color pickers */
#color-pickers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid #e9e9e7;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.color-item:hover {
    background: #f1f1ef;
    border-color: #d9d9d7;
}

.color-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #37352f;
    min-width: 60px;
}

.color-item input[type="color"] {
    border: none;
    background: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e9e9e7;
    transition: all 0.2s ease;
}

.color-item input[type="color"]:hover {
    border-color: #d9d9d7;
    transform: scale(1.05);
}

/* Timing section */
#timing-status {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2383e2;
}

#timing-status p {
    margin: 0;
    font-weight: 500;
    color: #37352f;
}

/* Terminal preview */
#terminal-container {
    margin-top: 1rem;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #333;
    min-height: 200px;
    overflow: auto;
}

#terminal-output {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #00ff00;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9e9e7;
    text-align: center;
    color: #787774;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    #app {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .controls, .color-controls, .timing-controls, .preview-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    #color-pickers {
        grid-template-columns: 1fr;
    }
}

/* Animation for section reveals */
section[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

section:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2383e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Terminal animation effects */
.terminal-typing {
    animation: blink 1s infinite;
}

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