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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

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

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-nav {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

@media (max-width: 768px) {
    .main-nav {
        justify-content: space-between;
    }
    
    .auth-nav {
        margin-left: 0;
    }
}

.auth-nav-item {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-item.active {
    background: white;
    color: #667eea;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

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

.input-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.instruction {
    margin-bottom: 20px;
    color: #718096;
    font-size: 1rem;
}

.instruction code {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: #e53e3e;
}

/* Lyrics Editor Styles */
.lyrics-editor-container {
    position: relative;
    margin-bottom: 15px;
}

.lyrics-editor {
    width: 100%;
    min-height: 150px;
    max-height: 300px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafbfc;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2d3748;
}

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

.lyrics-editor:empty:before {
    content: attr(data-placeholder);
    color: #a0aec0;
    pointer-events: none;
    display: block;
}

.marked-for-enhancement {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px dashed #f59e0b;
    cursor: pointer;
    position: relative;
    display: inline;
    font-weight: 500;
}

.marked-for-enhancement:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-color: #d97706;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.mark-btn, .clear-marks-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mark-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.mark-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

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

.read-aloud-btn, .stop-reading-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.read-aloud-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.stop-reading-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.stop-reading-btn:hover {
    background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.voice-settings {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    align-items: center;
}

.voice-select-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #4a5568;
    min-width: 250px;
}

.voice-select-label span:first-child {
    font-weight: 500;
    min-width: 50px;
}

.voice-select {
    flex: 1;
    min-width: 200px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #4a5568;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-select:hover {
    border-color: #667eea;
}

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

.voice-slider-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #4a5568;
    min-width: 180px;
}

.voice-slider-label span:first-child {
    font-weight: 500;
    min-width: 50px;
}

.voice-slider-label input[type="range"] {
    flex: 1;
    min-width: 100px;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.voice-slider-label input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.2s ease;
}

.voice-slider-label input[type="range"]::-webkit-slider-thumb:hover {
    background: #764ba2;
}

.voice-slider-label input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.voice-slider-label input[type="range"]::-moz-range-thumb:hover {
    background: #764ba2;
}

.voice-slider-label span:last-child {
    min-width: 35px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

.clear-marks-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.clear-marks-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.enhance-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.enhance-btn, .find-images-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    flex: 1;
    min-width: 200px;
}

.find-images-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.enhance-btn:hover, .find-images-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.find-images-btn:hover {
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.3);
}

.enhance-btn:active, .find-images-btn:active {
    transform: translateY(0);
}

.enhance-btn:disabled, .find-images-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.output-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
}

.output-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #2d3748;
}

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

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

.output-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.output-box-large {
    grid-column: 1 / -1;
}

.output-box h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.lyrics-output {
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #2d3748;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
}

.lyrics-output-with-dropdowns {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.95rem;
    line-height: 2;
    color: #2d3748;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-height: 500px;
    overflow-y: auto;
}

.lyric-line {
    margin: 8px 0;
    padding: 8px;
    border-radius: 4px;
}

.lyric-line-with-dropdown {
    margin: 12px 0;
    padding: 12px;
    background: #f0f4ff;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.line-base {
    color: #2d3748;
    font-weight: 500;
    flex-shrink: 0;
}

.alternative-dropdown {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alternative-dropdown:hover {
    border-color: #764ba2;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.alternative-dropdown:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Inline dropdowns in the editor */
.alternative-dropdown-inline {
    display: inline-block;
    min-width: 200px;
    padding: 4px 8px;
    border: 2px solid #48bb78;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
    vertical-align: baseline;
}

.alternative-dropdown-inline:hover {
    border-color: #38a169;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
}

.alternative-dropdown-inline:focus {
    outline: none;
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.2);
}

.apply-selections-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-selections-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.apply-selections-btn:active {
    transform: translateY(0);
}

.fallback-message {
    white-space: pre-wrap;
    line-height: 1.7;
}

.clear-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.example-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    border-left: 4px solid #667eea;
}

.example-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.example-section ol {
    padding-left: 20px;
}

.example-section li {
    margin-bottom: 8px;
    color: #4a5568;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Auth Section Styles */
.auth-section {
    margin-top: 15px;
}

.auth-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
    backdrop-filter: blur(10px);
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

#userInfo {
    color: white;
    font-weight: 500;
    margin-right: 15px;
}

.images-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
}

.images-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #2d3748;
}

.navigation-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.nav-arrow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.nav-arrow:active {
    transform: translateY(0);
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-arrow span {
    line-height: 1;
}

.analysis-summary {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    grid-column: 1 / -1;
}

.analysis-summary h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.analysis-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.analysis-item strong {
    color: #4a5568;
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.images-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding: 16px 0 0 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    scroll-behavior: smooth;
    position: relative;
    cursor: grab;
    user-select: none;
}

.images-container:active {
    cursor: grabbing;
}

.images-container.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.images-container::before,
.images-container::after {
    content: '';
    min-width: 16px;
    flex-shrink: 0;
}

.images-container::-webkit-scrollbar {
    height: 8px;
    position: absolute;
    top: 0;
}

.images-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
    margin: 0 20px;
}

.images-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.images-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.scroll-indicator {
    text-align: center;
    margin: 0 0 20px 0;
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.scroll-indicator::before {
    content: '← Scroll horizontally to see more images →';
}

@media (max-width: 768px) {
    .scroll-indicator::before {
        content: '← Swipe to see more images →';
    }
}

/* Hide scroll indicator when not needed */
.images-container:not([data-scrollable="true"]) .scroll-indicator {
    opacity: 0;
}

.results-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    grid-column: 1 / -1;
}

.results-summary h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: white;
}

.results-summary p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.9rem;
}

.image-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: fit-content;
    min-width: 240px;
    max-width: 240px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.image-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f4ff;
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.rank-badge.rank-top {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.rank-badge.rank-high {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.rank-badge.rank-medium {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.rank-badge.rank-low {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    box-shadow: 0 4px 15px rgba(160, 174, 192, 0.4);
}

.relevance-info h3 {
    font-size: 1rem;
    margin-bottom: 2px;
    color: #2d3748;
}

.total-score {
    color: #4a5568;
    font-size: 0.75rem;
}

.total-score strong {
    color: #667eea;
    font-size: 0.9rem;
}

.image-wrapper {
    position: relative;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #f7fafc;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.image-wrapper img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

.image-wrapper.loaded::before {
    display: none;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.image-wrapper.loaded {
    background: transparent;
}

.image-wrapper.error {
    background: #fed7d7;
    border: 2px dashed #e53e3e;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #718096;
    text-align: center;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.6;
}

.placeholder-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #a0aec0;
}

.image-card:hover img {
    transform: scale(1.02);
}

.image-description {
    color: #4a5568;
    line-height: 1.4;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scoring-breakdown {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 8px;
}

.scoring-breakdown h4 {
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 4px;
}

.scoring-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.scoring-item {
    background: white;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 0.7rem;
    color: #4a5568;
    font-family: 'Monaco', 'Menlo', monospace;
}

.filename-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.copy-filename-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-filename-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.copy-filename-btn:active {
    transform: translateY(0);
}

.filename-display {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    color: #4a5568;
    background: white;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    flex: 1;
    word-break: break-all;
    line-height: 1.3;
}

.image-info h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.relevance-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.relevance-badge.second {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.image-info p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 0.9rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.image-tag {
    background: #f7fafc;
    color: #4a5568;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.image-tag:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.match-score {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f0f4ff;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.match-score small {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.8rem;
}

/* Responsive adjustments for image tiles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    main {
        padding: 25px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .output-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .enhance-btn, .find-images-btn {
        width: 100%;
    }
    
    .navigation-controls {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .nav-arrow {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .images-container {
        gap: 14px;
        padding: 14px 0;
    }
    
    .image-card {
        padding: 10px;
        min-width: 220px;
        max-width: 220px;
    }
    
    .image-wrapper img {
        height: 280px;
    }
    
    .image-wrapper {
        min-height: 280px;
    }
    
    .rank-badge {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .image-header {
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .filename-section {
        padding: 6px;
        gap: 6px;
    }
    
    .copy-filename-btn {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .filename-display {
        font-size: 0.65rem;
        padding: 3px 4px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .enhance-btn, .find-images-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .navigation-controls {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .images-container {
        gap: 12px;
        padding: 12px 0;
    }
    
    .image-card {
        padding: 8px;
        min-width: 200px;
        max-width: 200px;
    }
    
    .image-wrapper img {
        height: 240px;
    }
    
    .image-wrapper {
        min-height: 240px;
    }
    
    .rank-badge {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .image-header {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .image-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .scoring-breakdown {
        padding: 6px;
    }
    
    .scoring-item {
        font-size: 0.65rem;
        padding: 3px 4px;
    }
    
    .filename-section {
        padding: 4px;
        gap: 4px;
        margin: 6px 0;
    }
    
    .copy-filename-btn {
        padding: 2px 4px;
        font-size: 0.6rem;
    }
    
    .filename-display {
        font-size: 0.6rem;
        padding: 2px 3px;
    }
}

/* ============================================
   SONG SAVE/LOAD STYLES
   ============================================ */

.songs-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e2e8f0;
}

.songs-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #2d3748;
}

.songs-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.save-song-btn, .load-songs-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-song-btn:hover, .load-songs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.save-song-btn:active, .load-songs-btn:active {
    transform: translateY(0);
}

.songs-list {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.song-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.song-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.song-info {
    flex: 1;
    margin-right: 15px;
}

.song-info h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.song-preview {
    color: #4a5568;
    font-size: 0.9rem;
    margin: 8px 0;
    line-height: 1.5;
}

.song-info small {
    color: #718096;
    font-size: 0.85rem;
}

.song-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.load-song-btn, .view-versions-btn, .delete-song-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.load-song-btn {
    background: #48bb78;
    color: white;
}

.load-song-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.view-versions-btn {
    background: #667eea;
    color: white;
}

.view-versions-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.delete-song-btn {
    background: #e53e3e;
    color: white;
}

.delete-song-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.5rem;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

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

.save-options {
    margin: 15px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.save-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 8px;
}

.save-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.save-options small {
    display: block;
    margin-top: 8px;
    color: #718096;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.authors-list {
    margin-bottom: 10px;
}

.author-input {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.author-input input[type="text"],
.author-input input[type="email"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.author-input select {
    flex: 0 0 140px;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.author-input .remove-author-btn {
    flex: 0 0 30px;
    padding: 10px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    font-weight: bold;
}

.author-input .remove-author-btn:hover {
    background: #c53030;
}

.add-author-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.add-author-btn:hover {
    background: #5568d3;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.confirm-btn, .cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.confirm-btn {
    background: #48bb78;
    color: white;
}

.confirm-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.cancel-btn:hover {
    background: #cbd5e0;
}

/* Version History Styles */
.version-history-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.version-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.version-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.version-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.version-header small {
    color: #718096;
    font-size: 0.85rem;
}

.version-notes {
    color: #4a5568;
    font-style: italic;
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.version-preview {
    color: #718096;
    font-size: 0.9rem;
    margin: 10px 0;
    line-height: 1.5;
}

.version-actions {
    margin-top: 12px;
}

.load-version-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.load-version-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

#currentVersionInfo {
    display: inline-block;
    padding: 6px 12px;
    background: #e6fffa;
    color: #234e52;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #81e6d9;
}

/* Responsive adjustments for song management */
@media (max-width: 768px) {
    .song-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .song-info {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .song-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-large {
        max-width: 95%;
    }
} 