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

body {
    font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1db954 0%, #191414 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Animated background elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(29, 185, 84, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(29, 185, 84, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(29, 185, 84, 0.1) 0%, transparent 50%);
    animation: backgroundPulse 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Container styles */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.results-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography */
h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #1db954, #1ed760, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(29, 185, 84, 0.3);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Button styles */
.btn {
    background: linear-gradient(45deg, #1db954, #1ed760);
    border: none;
    border-radius: 50px;
    color: #000000;
    font-size: 1rem;
    font-weight: 700;
    padding: 1rem 2rem;
    margin: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(29, 185, 84, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(29, 185, 84, 0.4);
    background: linear-gradient(45deg, #1ed760, #1db954);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 8px 20px rgba(29, 185, 84, 0.5);
}

.btn:disabled {
    background: linear-gradient(45deg, #666, #888);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Button group */
.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

/* Results page specific styles */
.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-header h1 {
    margin-bottom: 1rem;
}

.status-message {
    background: rgba(29, 185, 84, 0.1);
    border: 2px solid rgba(29, 185, 84, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(29, 185, 84, 0.3);
        border-color: rgba(29, 185, 84, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(29, 185, 84, 0.5);
        border-color: rgba(29, 185, 84, 0.5);
    }
}

/* Image container */
.image-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding: 2rem 0;
}

.image-container img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: imageAppear 0.6s ease-out forwards;
}

.image-container img:nth-child(1) { animation-delay: 0.1s; }
.image-container img:nth-child(2) { animation-delay: 0.2s; }
.image-container img:nth-child(3) { animation-delay: 0.3s; }
.image-container img:nth-child(4) { animation-delay: 0.4s; }
.image-container img:nth-child(5) { animation-delay: 0.5s; }

@keyframes imageAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.image-container img:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 25px 50px rgba(29, 185, 84, 0.4);
    border: 3px solid rgba(29, 185, 84, 0.6);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(29, 185, 84, 0.3);
    border-radius: 50%;
    border-top-color: #1db954;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Floating particles animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(29, 185, 84, 0.6);
    border-radius: 50%;
    animation: float 6s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    background: linear-gradient(145deg, #191414, #2a2a2a);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-body {
    display: flex;
    height: 100%;
    gap: 2rem;
    padding: 2rem;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    line-height: 1;
    text-align: center;
    user-select: none;
}

.close:hover,
.close:focus {
    color: #1db954;
    background: rgba(29, 185, 84, 0.2);
    transform: rotate(90deg);
}

#modalImage {
    flex: 1;
    max-width: 60%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.modal-info {
    flex: 1;
    max-width: 40%;
    padding: 1rem;
    overflow-y: auto;
}

.modal-info h3 {
    color: #1db954;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#songList {
    list-style: none;
    padding: 0;
}

#songList li {
    background: rgba(29, 185, 84, 0.1);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin: 0.5rem 0;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#songList li::before {
    content: '♪';
    color: #1db954;
    font-weight: bold;
    margin-right: 0.5rem;
}

#songList li:hover {
    background: rgba(29, 185, 84, 0.2);
    border-color: rgba(29, 185, 84, 0.5);
    transform: translateX(5px);
}

/* Add cursor pointer to images */
.image-container img {
    cursor: pointer;
    position: relative;
}

.image-container img::after {
    content: '🔍 Click to view details';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container img:hover::after {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .results-container {
        padding: 1rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 250px;
        margin: 0.5rem 0;
    }
    
    .image-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
    
    .modal-body {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    #modalImage {
        max-width: 100%;
        max-height: 50%;
    }
    
    .modal-info {
        max-width: 100%;
        max-height: 50%;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.btn:focus {
    outline: 3px solid rgba(29, 185, 84, 0.5);
    outline-offset: 2px;
}

/* Error message styles */
.error-message {
    background: rgba(229, 57, 53, 0.1);
    border: 2px solid rgba(229, 57, 53, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    color: #ff6b6b;
    backdrop-filter: blur(10px);
}

/* Add styles for the new prompt details section */
.prompt-details {
    background: rgba(29, 185, 84, 0.1);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.prompt-details h4 {
    color: #1db954;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.prompt-details .detail-item {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.prompt-details .detail-item:not(.full-width) span:last-child {
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.4;
}

.prompt-details .detail-label {
    color: #1db954;
    font-weight: bold;
}

.prompt-details .detail-item.full-width {
    display: block;
    margin-top: 1rem;
}

.prompt-details .detail-item.full-width .detail-label {
    display: block;
    margin-bottom: 0.5rem;
}

.prompt-details .detail-item.full-width span:last-child {
    display: block;
    line-height: 1.6;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border-left: 3px solid #1db954;
}

/* Custom Error Modal Styles */
.error-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #ff6b6b;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: errorModalSlideIn 0.3s ease-out;
}

@keyframes errorModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.error-modal-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.error-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.error-title {
    font-size: 1.3rem;
    font-weight: bold;
    flex: 1;
}

.error-close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.error-close:hover {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.3);
}

.error-modal-body {
    padding: 2rem;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-line;
}

.error-modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.error-ok-button {
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.error-ok-button:hover {
    background: linear-gradient(135deg, #1ed760 0%, #1db954 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 185, 84, 0.3);
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    text-align: center;
    z-index: 1000;
}

.footer p {
    margin: 0;
    color: #ffffff;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer a {
    color: #1db954;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: #1ed760;
    text-decoration: underline;
    opacity: 1;
}

/* Ensure content doesn't get hidden behind footer */
body {
    padding-bottom: 60px;
}

/* Adjust for pages with modals */
.modal {
    z-index: 10000;
}