body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e; /* Dark theme background */
    color: #e4e4e4;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Start from the top to maximize screen space */
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box; /* Include padding in height calculation */
}

.container {
    background-color: #2a2a4a; /* Darker container background */
    padding: 15px; /* Reduced padding for mobile space */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%; /* Maximize width */
    max-width: 500px;
    margin-top: 5px; /* Minimal top margin */
}

h1 {
    color: #a988fa; /* Accent color */
    margin-bottom: 10px;
    font-size: 1.5em;
}

p {
    color: #b0b0d0;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.file-upload {
    margin-bottom: 15px;
    border: 1px solid #4a4a6e;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    background-color: #3b3b5c;
}

.file-upload:hover {
    border-color: #7f7f9f;
}

.file-upload label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #e4e4e4;
    cursor: pointer;
}

.file-upload input[type="file"] {
    display: block;
    margin: 8px auto 0;
}

.controls, .ai-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #4a4a6e;
}

.controls button, .ai-controls button {
    padding: 12px 15px; /* Increased touch area */
    margin: 4px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.controls button:active, .ai-controls button:active {
    transform: translateY(1px);
}


/* --- Button Color Scheme --- */

/* User Crowd Buttons */
#generateBtn {
    background-color: #4CAF50; /* Green Play */
    color: white;
}
#generateBtn:disabled { background-color: #79a87b; cursor: not-allowed; }
#generateBtn:hover:not(:disabled) { background-color: #45a049; }

#downloadBtn {
    background-color: #2196F3; /* Blue Download */
    color: white;
}
#downloadBtn:disabled { background-color: #89cff0; cursor: not-allowed; }
#downloadBtn:hover:not(:disabled) { background-color: #1e88e5; }

#stopBtn {
    background-color: #F44336; /* Red Stop */
    color: white;
}
#stopBtn:disabled { background-color: #ff8a80; cursor: not-allowed; }
#stopBtn:hover:not(:disabled) { background-color: #d32f2f; }


/* AI specific sections */
.ai-controls h2 {
    color: #a988fa; 
    margin-bottom: 10px;
    font-size: 1.3em;
}

/* AI Generation Buttons */
#aiGenerateBtn {
    background-color: #9c27b0; /* Deep Purple AI Play */
    color: white;
}
#aiGenerateBtn:disabled { background-color: #ce93d8; cursor: not-allowed; }
#aiGenerateBtn:hover:not(:disabled) { background-color: #8e24aa; }

#aiDownloadBtn {
    background-color: #03a9f4; /* Light Blue AI Download */
    color: white;
}
#aiDownloadBtn:disabled { background-color: #81d4fa; cursor: not-allowed; }
#aiDownloadBtn:hover:not(:disabled) { background-color: #039be5; }

#aiStopBtn {
    background-color: #F44336; /* Red Stop */
    color: white;
}
#aiStopBtn:disabled { background-color: #ff8a80; cursor: not-allowed; }
#aiStopBtn:hover:not(:disabled) { background-color: #d32f2f; }

/* AI Utility Buttons (Upload/Record) */
#aiUploadButton {
    background-color: #ffeb3b; /* Yellow Upload */
    color: #333;
}
#aiUploadButton:disabled { background-color: #fff176; cursor: not-allowed; }
#aiUploadButton:hover:not(:disabled) { background-color: #fdd835; }

#aiRecordButton {
    background-color: #ff9800; /* Orange Record */
    color: white;
}
#aiRecordButton:disabled { background-color: #ffcc80; cursor: not-allowed; }
#aiRecordButton:hover:not(:disabled) { background-color: #fb8c00; }

#aiStopRecordButton {
    background-color: #e91e63; /* Pink Stop Recording */
    color: white;
}
#aiStopRecordButton:disabled { background-color: #f8bbd0; cursor: not-allowed; }
#aiStopRecordButton:hover:not(:disabled) { background-color: #c2185b; }

.sync-buttons {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    margin-top: 10px;
    gap: 5px; /* Add gap between sync buttons */
}

.sync-buttons button { 
    background-color: #607d8b; /* Blue Gray Sync */
    color: white;
    margin: 0; /* Remove previous margins, rely on gap */
    flex-grow: 1; 
    min-width: 44px; /* Ensure touch minimum */
    font-size: 0.8em; /* Smaller font for more compact layout */
    padding: 8px 10px;
}

.sync-buttons button:disabled { background-color: #b0bec5; cursor: not-allowed; }
.sync-buttons button:hover:not(:disabled) { background-color: #546e7a; }

/* Parameter Input Styling */
.parameter {
    margin-top: 10px; /* Reduced margin */
    text-align: left;
    padding: 0 5px; /* Reduced padding */
    display: flex;
    flex-direction: column; /* Stack label and input/select vertically */
    align-items: flex-start;
}

.parameter label {
    flex: none;
    margin-right: 0;
    margin-bottom: 5px;
    color: #b0b0d0;
    font-size: 0.9em;
}

.parameter input[type="number"],
.parameter input[type="range"],
.parameter input[type="text"], 
.parameter select { /* Added select */
    flex: 1;
    width: 100%; /* Full width for better mobile interaction */
    padding: 8px;
    border: 1px solid #4a4a6e;
    border-radius: 4px;
    background-color: #3b3b5c;
    color: #e4e4e4;
    box-sizing: border-box;
}
.parameter select {
    appearance: none; /* Remove default styling on some browsers */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23e4e4e4" d="M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

#status, #aiStatus { 
    margin-top: 15px;
    padding: 10px;
    background-color: #3b3b5c;
    border-radius: 6px;
    color: #03a9f4; /* Light Blue for status */
    font-weight: 600;
    font-size: 0.9em;
}

#downloadLink {
    display: inline-block;
    padding: 12px 20px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    font-size: 1em;
}

#downloadLink:hover {
    background-color: #45a049;
}