/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica', 'Arial', sans-serif;
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding-top: 20px;
}

/* Search Container */
.search-container {
    position: relative;
    margin-bottom: 0px;
}

.search-box {
    position: relative;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 20px 60px 20px 25px;
    font-size: 1.1rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.search-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    pointer-events: none;
    opacity: 0.5;
}

.material-symbols-outlined {
    font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

.search-status {
    text-align: center;
    margin-top: 0px;
    color: white;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Results Modal */
.results-modal {
    background: white;
    border-radius: 10px;
    border: 1px solid #ccc;
    margin-top: 0px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.results-modal.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.results-count {
    color: #000;
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn .material-symbols-outlined {
    font-size: 1.5rem;
}


/* Results Container */
.results-container {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}

.results-container::-webkit-scrollbar {
    width: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.results-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Track Item */
.track-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 10px;
    margin: 5px;
}

.track-item:hover {
    background: #f8f9fa;
}

.track-item:last-child {
    border-bottom: none;
}

.track-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.track-artist {
    font-size: 1rem;
    color: #666;
    margin-bottom: 8px;
}

.track-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #666;
}

.meta-badge.isrc {
    background: #e3f2fd;
    color: #1976d2;
    font-family: 'Courier New', monospace;
}

.meta-badge.track-id {
    background: #f3e5f5;
    color: #7b1fa2;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-spinner p {
    color: #666;
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 20px 20px;
    color: #999;
}

.no-results.hidden {
    display: none;
}

.no-results p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.no-results small {
    font-size: 0.95rem;
    color: #bbb;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #d32f2f;
}

.error-message.hidden {
    display: none;
}

.error-message p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.error-message small {
    font-size: 0.9rem;
    color: #999;
    display: block;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-top: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #searchInput {
        padding: 18px 50px 18px 20px;
        font-size: 1rem;
    }

    .results-modal {
        max-height: 500px;
    }

    .track-name {
        font-size: 1.1rem;
    }

    .track-artist {
        font-size: 0.95rem;
    }

    .track-album {
        font-size: 0.9rem;
    }

    .meta-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .results-modal {
        border-radius: 15px;
    }

    .track-item {
        padding: 15px;
    }

    .track-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Versions badge in search results */
.meta-badge.versions {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 500;
}

/* Page Footer */
.page-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 0;
    margin-top: 40px;
    border-top: 2px solid #eee;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.footer-user-info {
    display: flex;
    align-items: center;
}

.user-email {
    color: #555;
}

.logout-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
}

.logout-btn:hover {
    color: #5a6fd8;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-contact {
    text-align: left;
}

.footer-contact a {
    color: #667eea;
    text-decoration: none;
}

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

.footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-circle {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.3s ease;
}

.status-circle.online {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.status-circle.offline {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.4);
}

/* Versions section on ISRC page */
.versions-section {
    margin: 0 0 20px 0;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.versions-section.hidden {
    display: none;
}

.toggle-versions-btn {
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #555;
    transition: background 0.2s ease;
}

.versions-label {
    flex: 1;
    text-align: left;
}

.toggle-versions-btn:hover {
    background: #eee;
}

.toggle-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.versions-list {
    padding: 0 20px 15px 20px;
    border-top: 1px solid #e0e0e0;
}

.versions-list.hidden {
    display: none;
}

.version-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.version-item:last-child {
    border-bottom: none;
}

.version-album {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.version-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
}

.version-id {
    font-family: 'Courier New', monospace;
    color: #888;
    font-size: 0.8rem;
}

.spotify-link {
    color: #1db954;
    text-decoration: none;
    font-weight: 500;
}

.spotify-link:hover {
    text-decoration: underline;
}

/* Date Range Selector */
.date-range-section {
    margin: 0 0 20px 0;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.date-range-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.country-selector {
    flex: 1;
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    height: 46px;
    line-height: 1.2;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

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

.country-selector:focus {
    outline: none;
    border-color: #667eea;
    color: #667eea;
}

.date-range-btn {
    flex: 1;
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.date-range-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.date-range-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.custom-date-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.custom-date-inputs.hidden {
    display: none;
}

.custom-date-inputs label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.custom-date-inputs label span {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.custom-date-inputs input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.apply-custom-btn {
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.apply-custom-btn:hover {
    background: #5a6fd8;
}

/* Tracked Items Section */
.tracked-section {
    margin: 30px 0 20px 0;
    background: white;
    border-radius: 10px;
    border: 1px solid #ccc;
    padding: 20px;
}

.tracked-section.hidden {
    display: none;
}

.tracked-section h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.tracked-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tracked-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.tracked-item:hover {
    background: #eef0f5;
    border-color: #667eea;
}

.tracked-item-content {
    flex: 1;
    cursor: pointer;
}

.tracked-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.tracked-item-artist {
    font-size: 0.95rem;
    color: #666;
}

.tracked-item-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #999;
    margin-left: 10px;
}

.delete-tracked-btn {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.delete-tracked-btn .material-symbols-outlined {
    font-size: 1.2rem;
}

.delete-tracked-btn:hover {
    opacity: 1;
    background: #fee;
    color: #d32f2f;
}

