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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.upload-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    border: 2px dashed #3498db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(52, 152, 219, 0.1);
    width: 100%;
    max-width: 400px;
}

.upload-label:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.upload-label svg {
    margin-bottom: 1rem;
    color: #3498db;
}

.upload-label span {
    font-size: 1.2rem;
    color: #3498db;
}

.media-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fafafa;
}

#displayImage, [id^="displayImage-"] {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.remove-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
}

.remove-image-btn:hover {
    background-color: #c0392b;
}

.stats-container {
    padding: 1rem;
}

h2, h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-box h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.color-palette {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
}

.palette-color {
    flex: 1;
    height: 100%;
}

.color-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.color-box {
    height: 30px;
    width: 100%;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.reset-btn {
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.reset-btn:hover {
    background-color: #2980b9;
}

.ai-analysis-container {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.ai-analysis-content {
    background-color: white;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    font-style: italic;
    line-height: 1.6;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

audio {
    width: 100%;
    margin-bottom: 0.5rem;
}

.audio-visualization {
    width: 100%;
    height: 150px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .image-container {
        grid-template-columns: 1fr;
    }
    
    .media-gallery {
        grid-template-columns: 1fr;
    }
    
    .stats-row, .color-stats {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) {
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(900px, 1fr));
    }
}