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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 40px;
}

.header {
    margin-bottom: 40px;
}

.back-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 1rem;
}

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

/* Tiles */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tile {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.tile-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tile-disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tile-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.tile h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.tile p {
    color: #7f8c8d;
}

/* Upload sections */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.help-text {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Dropzone */
.dropzone {
    border: 3px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.dropzone:hover, .dropzone.dragover {
    border-color: #3498db;
    background: #f0f8ff;
}

.dropzone p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Previews */
.previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: move;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Audio list */
.audio-list {
    margin-top: 20px;
}

.audio-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: move;
}

.audio-item .number {
    background: #3498db;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.audio-item .info {
    flex: 1;
}

.audio-item .filename {
    font-weight: 500;
    margin-bottom: 3px;
}

.audio-item .duration {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.audio-item .remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.audio-item .remove-btn:hover {
    background: #c0392b;
}

.total-duration {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    font-weight: 500;
    color: #2e7d32;
}

/* Configuration */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.config-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.config-item input,
.config-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.actions {
    text-align: center;
    margin-top: 40px;
}

.error-message {
    color: #e74c3c;
    margin-top: 15px;
    font-weight: 500;
}

/* Status page */
.status-container {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status-message {
    margin-bottom: 40px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.status-message p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 30px;
}

.error-display {
    background: #fee;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 30px;
    color: #c0392b;
}

.error-display h3 {
    margin-bottom: 15px;
}

.download-section {
    margin-top: 30px;
}

.download-section h2 {
    font-size: 2rem;
    color: #2ecc71;
    margin-bottom: 30px;
}

/* Drag and drop effects */
.dragging {
    opacity: 0.5;
}

.drag-over {
    border: 2px solid #3498db;
    background: #f0f8ff;
}

/* Audio status */
.audio-status {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.audio-status.active {
    display: block;
}

.audio-status .filename {
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.audio-status .duration {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.audio-status .remove-audio {
    margin-top: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.audio-status .remove-audio:hover {
    background: #c0392b;
}