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

body {
    font-family: 'Inter', sans-serif;
    background: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

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

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

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    color: #000000;
}

/* Logo Styles */
.logo-container {
    margin-bottom: 20px;
}

.app-logo {
    max-width: 500px;
    height: auto;
    max-height: 160px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

/* Responsive logo */
@media (max-width: 768px) {
    .app-logo {
        max-width: 360px;
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .app-logo {
        max-width: 300px;
        max-height: 100px;
    }
}

/* Mobile background optimization */
@media (max-width: 768px) {
    body {
        background-attachment: scroll; /* Better mobile performance */
    }
}

.config-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.config-toggle {
    text-align: center;
}

#configToggle {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#configToggle:hover {
    background: #5a6268;
}

.config-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.config-panel h3 {
    margin-bottom: 10px;
    color: #333;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.config-panel p {
    text-align: center;
    margin-bottom: 20px;
    color: #444;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.config-panel a {
    color: #667eea;
    text-decoration: none;
}

.config-panel a:hover {
    text-decoration: underline;
}

.config-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

#apiKeyInput {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

#modelSelect {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
}

#saveConfig {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#saveConfig:hover {
    background: #218838;
}

.config-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.config-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.config-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.config-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.config-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.config-tab:hover {
    color: #333;
}

.config-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.config-content {
    display: none;
}

.config-content.active {
    display: block;
}

.setup-instructions {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #e7f3ff;
    border-radius: 8px;
    border: 1px solid #bee5ff;
}

.setup-instructions a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.setup-instructions a:hover {
    text-decoration: underline;
}

.spotify-setup {
    max-width: 500px;
    margin: 0 auto;
}

.setup-step {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1db954;
}

.setup-step h4 {
    margin-bottom: 8px;
    color: #333;
}

.setup-step p {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.setup-step code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

#spotifyClientId {
    width: 100%;
    margin-bottom: 10px;
}

#saveSpotifyConfig {
    background: #1db954;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#saveSpotifyConfig:hover {
    background: #1ed760;
}

.spotify-controls {
    text-align: center;
    margin-top: 20px;
}

.spotify-controls button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#connectSpotify, #getCurrentTrack {
    background: #1db954;
    color: white;
}

#connectSpotify:hover, #getCurrentTrack:hover {
    background: #1ed760;
}

#testCurrentTrack {
    background: #ff6b6b;
    color: white;
}

#testCurrentTrack:hover {
    background: #ff5252;
}

#disconnectSpotify {
    background: #f44336;
    color: white;
}

#disconnectSpotify:hover {
    background: #d32f2f;
}

/* Status indicators */
.status-connected {
    color: #4CAF50;
    font-weight: bold;
}

.status-disconnected {
    color: #f44336;
    font-weight: bold;
}

.status-info {
    color: #2196F3;
    font-weight: bold;
}

#disconnectSpotify {
    background: #dc3545;
    color: white;
}

#disconnectSpotify:hover {
    background: #c82333;
}

#refreshCurrentTrack {
    background: #6c757d;
    color: white;
}

#refreshCurrentTrack:hover {
    background: #5a6268;
}

.spotify-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.spotify-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.spotify-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.spotify-player {
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(29, 185, 84, 0.3);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.track-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.track-details {
    flex: 1;
}

.track-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.track-details p {
    margin: 2px 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.player-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-actions button {
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.player-actions button:hover:not(:disabled) {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.player-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

#searchBtn {
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#searchBtn:hover {
    background: #5a6fd8;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.search-result-item h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.search-result-item p {
    color: #666;
    font-size: 14px;
}

/* New enhanced search result styles */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.result-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.relevance-high, .relevance-medium, .lyrics-available, .lyrics-unavailable {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.relevance-high {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.relevance-medium {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #faeeba;
}

.lyrics-available {
    background: #e7f3ff;
    color: #0056b3;
    border: 1px solid #bee5eb;
}

.lyrics-unavailable {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-details p {
    margin: 2px 0;
}

.search-tips {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.search-tips h5 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

.search-tips ul {
    margin-left: 20px;
    color: #6c757d;
    font-size: 13px;
}

.search-tips li {
    margin-bottom: 4px;
}

.lyrics-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.lyrics-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

#songTitle {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

#artistAlbum {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.lyrics-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

#translateTo {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    min-width: 250px;
}

#translateBtn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#translateBtn:hover {
    background: #218838;
}

.lyrics-content {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.lyrics-column {
    flex: 1;
}

.lyrics-column h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.lyrics-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 16px;
    color: #444;
    white-space: pre-line;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
}

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

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

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    opacity: 0.8;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .lyrics-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .lyrics-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    #translateTo {
        min-width: auto;
        width: 100%;
    }
    
    .config-form {
        flex-direction: column;
    }
    
    #apiKeyInput, #modelSelect {
        min-width: auto;
        width: 100%;
    }
    
    .player-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .track-image {
        width: 100px;
        height: 100px;
    }
    
    .player-actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Scrollbar Styling */
.search-results::-webkit-scrollbar,
.lyrics-text::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track,
.lyrics-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb,
.lyrics-text::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover,
.lyrics-text::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
