body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background-color: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 30px;
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    color: #e0e0e0;
    text-align: center;
    margin-bottom: 20px;
}

.main-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.controls-panel {
    flex: 1;
    min-width: 300px;
    background-color: #3a3a3a;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.controls-panel h2 {
    color: #e0e0e0;
    margin-top: 0;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.controls-panel h3 {
    color: #e0e0e0;
    margin-top: 0;
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 1px dashed #555;
}

.effect-group, .playback-controls, .text-controls, .audio-controls, .overlay-controls > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.effect-group label, .text-controls label, .audio-controls label, .overlay-controls label {
    font-weight: bold;
    color: #ccc;
}

input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    background: #555;
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
}

input[type="file"] {
    background-color: #444;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    cursor: pointer;
}

textarea,
input[type="number"],
input[type="color"],
select {
    background-color: #444;
    border: 1px solid #555;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

button#addImageBtn,
button#addTextBtn,
button#addSpeechBtn,
button#addTextOverlayBtn,
button#addImageOverlayBtn {
    margin-top: 10px;
}

.timeline-container {
    background-color: #4a4a4a;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.timeline-container h3 {
    margin-top: 0;
    color: #e0e0e0;
    border-bottom: 1px solid #666;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

#timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item {
    background-color: #f0f0f0;
    color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    border: 1px solid #d0d0d0;
    cursor: grab; /* Indicate draggable */
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover {
    background-color: #e0e0e0;
    border-color: #b0b0b0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline-item.active-clip {
    background-color: #cfe2ff;
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.4);
    font-weight: bold;
}

/* Drag and Drop Styles */
.timeline-item.dragging {
    opacity: 0.4;
    border: 2px dashed #007bff;
    cursor: grabbing;
}

.timeline-item.drag-over {
    background-color: #aaccff; /* Lighter blue to indicate potential drop target */
    border-color: #007bff;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
}

.timeline-item button.remove-clip-btn {
    background-color: #dc3545;
    padding: 5px 8px;
    font-size: 0.8em;
    margin-left: 10px;
    flex-shrink: 0;
    cursor: pointer; /* Override grab cursor for button */
}

.timeline-item button.remove-clip-btn:hover {
    background-color: #c82333;
}

.preview-panel {
    flex: 2;
    min-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    .controls-panel, .preview-panel {
        min-width: unset;
        width: 100%;
    }
}

/* Import a pixel-art-like font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}