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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: scale(1.02);
}

.upload-content .upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.upload-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #666;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.analysis-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: 1fr;
    }
}

.scale-analysis, .chord-suggestions {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.scale-analysis h2, .chord-suggestions h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.scale-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scale-info > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.scale-info label {
    font-weight: 600;
    color: #555;
}

.scale-info span {
    font-weight: 500;
    color: #333;
}

.notes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.note-chip {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.chord-list {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.chord-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.chord-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.chord-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.chord-notes {
    font-size: 0.9rem;
    color: #666;
}

.chord-function {
    background: #e8f2ff;
    color: #2c5282;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.export-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.export-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.export-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.export-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.additional-info {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.additional-info summary {
    font-weight: 600;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.additional-info summary:hover {
    background-color: #e2e8f0;
}

.details-content {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    line-height: 1.6;
}

.info-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
}

.info-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-section p {
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #e53e3e;
}

.success {
    background: #c6f6d5;
    color: #2f855a;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #38a169;
}

/* Guitar Tab Styles */
.guitar-tabs-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.guitar-tabs-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
}

.guitar-tabs-section h2::before {
    content: "🎸";
    margin-right: 10px;
    font-size: 1.2em;
}

.tab-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tuning-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tab-buttons {
    display: flex;
    gap: 10px;
}

.tab-control-btn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.tab-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

/* Tuning Selector Styles */
.tuning-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tuning-selector-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.tuning-selector {
    padding: 6px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tuning-selector:hover {
    border-color: #667eea;
}

.tuning-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tuning Display Styles */
.tuning-display {
    text-align: center;
}

.tuning-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.tuning-strings {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #4a5568;
}

.tuning-string {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid #e2e8f0;
}

/* Drop D specific styling */
.tuning-string:first-child {
    background: #fed7d7;
    color: #c53030;
    border-color: #feb2b2;
}

.guitar-tabs-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chord-tab-container {
    background: #f8f9ff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.chord-tab-container:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.chord-tab-container.no-tab {
    opacity: 0.7;
    border-style: dashed;
}

.chord-tab-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.chord-roman {
    font-weight: bold;
    font-size: 1.1rem;
    color: #4a5568;
}

.chord-function-label {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.guitar-chord-container {
    text-align: center;
}

.chord-name-header {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 8px;
}

.fingering-name {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
}

.tab-diagram {
    font-family: 'Courier New', monospace;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
}

.fret-header {
    display: flex;
    margin-bottom: 5px;
    font-weight: bold;
    color: #4a5568;
}

.string-row {
    display: flex;
    margin: 3px 0;
    align-items: center;
}

.string-label {
    width: 20px;
    text-align: center;
    font-weight: bold;
    color: #2d3748;
    margin-right: 8px;
}

.fret-label {
    width: 25px;
    text-align: center;
    font-size: 0.8rem;
    color: #718096;
}

.fret-cell {
    width: 25px;
    height: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.fret-cell.fretted {
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
}

.fret-cell.open {
    color: #48bb78;
    font-weight: bold;
}

.fret-cell.muted {
    color: #e53e3e;
    font-weight: bold;
}

.difficulty-indicator {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #718096;
}

.difficulty-indicator span {
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 12px;
}

.fingering-selector-container {
    text-align: center;
}

.fingering-selector {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.diagram-container {
    min-height: 200px;
}

.compact-tab-container {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.compact-chord-name {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2d3748;
}

.compact-tab-notation {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.tab-string-line {
    margin: 2px 0;
    display: flex;
    align-items: center;
}

.string-name {
    color: #4a5568;
    font-weight: bold;
    margin-right: 5px;
}

.fret-notation {
    color: #2d3748;
}

.no-tab-available {
    text-align: center;
    padding: 20px;
    color: #718096;
}

.no-tab-message {
    font-style: italic;
    margin-top: 8px;
}

.no-tabs-message {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

.guitar-help-info {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    border-left: 4px solid #667eea;
}

.guitar-help-info h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.guitar-help-info ul {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.guitar-help-info li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.guitar-help-info li::before {
    content: "♪";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.guitar-help-info p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .guitar-tabs-list {
        grid-template-columns: 1fr;
    }
    
    .tab-diagram {
        font-size: 0.8rem;
    }
    
    .fret-cell {
        width: 20px;
        font-size: 0.9rem;
    }
    
    .fret-label {
        width: 20px;
    }
    
    .tab-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tuning-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .tuning-strings {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tuning-selector {
        font-size: 0.85rem;
        padding: 4px 8px;
    }
}