/* Main Styles for Vinyl Animation Creator */
:root {
    --primary-color: #6200ee;
    --primary-dark: #3700b3;
    --primary-light: #bb86fc;
    --secondary-color: #03dac6;
    --background: #121212;
    --surface: #1e1e1e;
    --error: #cf6679;
    --on-primary: #ffffff;
    --on-secondary: #000000;
    --on-background: #ffffff;
    --on-surface: #ffffff;
    --on-error: #000000;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background);
    color: var(--on-background);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

header p {
    font-size: 1.2rem;
    color: var(--on-background);
    opacity: 0.87;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

button {
    cursor: pointer;
    background-color: var(--primary-color);
    color: var(--on-primary);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--primary-dark);
}

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

/* Upload Section */
.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .upload-section {
        grid-template-columns: 1fr;
    }
}

.upload-box {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropzone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.dropzone.active {
    border-color: #6200ee;
    background-color: rgba(98, 0, 238, 0.1);
}

.dropzone input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.dropzone label {
    background-color: #6200ee;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.dropzone label:hover {
    background-color: #3700b3;
}

.upload-limit {
    display: block;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.preview {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

#change-cover {
    display: block;
    margin: 0 auto;
}

.audio-info {
    margin-top: 1rem;
}

.audio-info p {
    margin-bottom: 0.5rem;
}

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

/* Waveform Section */
.waveform-section {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#waveform {
    margin-bottom: 1rem;
    background-color: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    min-height: 100px;
    position: relative;
}

.loading-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(30, 30, 30, 0.9);
    color: var(--primary-light);
    font-size: 1.2rem;
    z-index: 10;
    pointer-events: none;
}

/* Styling voor de geselecteerde regio in wavesurfer */
.wavesurfer-region {
    position: absolute;
    top: 0 !important;
    height: 100% !important;
    z-index: 2;
    cursor: move !important;
    transition: box-shadow 0.3s ease;
    border: 2px solid #00e5ff !important;
    border-radius: 4px;
    overflow: hidden;
}

/* Highlight the region on hover to indicate it's draggable */
.wavesurfer-region:hover {
    box-shadow: 0 0 8px #00e5ff !important;
}

/* Add a fixed width indicator on the region */
.wavesurfer-region::before {
    content: "5-30 sec";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #00e5ff;
    color: #121212;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    pointer-events: none;
    opacity: 0.9;
}

/* Add drag indicators on the sides */
.wavesurfer-region::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--primary-light);
    border-radius: 2px;
    opacity: 0.7;
}

/* Verberg de standaard progress bar en weergave */
#waveform > wave > wave {
    display: none !important;
}

/* Fix voor de progress indicator (alleen zichtbaar in de regio) */
.wavesurfer-region wave {
    background-color: var(--primary-color) !important;
    opacity: 0.5;
    display: block !important;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    max-width: 100%;
    z-index: 5;
}

/* Styling voor de voortgangsindicator in de geselecteerde regio */
.region-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
    transition: width 0.05s linear;
}

/* Active region styles */
.active-region {
    border: 2px solid #00e5ff !important;
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.6) !important;
}

.waveform-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#time-display, #selection-display {
    font-family: monospace;
}

#selection-display {
    margin-left: auto;
}

/* Background Section */
.background-section {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bg-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bg-option {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bg-option label {
    min-width: 80px;
}

.bg-option input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.bg-option label[for="bg-image-input"] {
    background-color: #6200ee;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.bg-option label[for="bg-image-input"]:hover:not(.disabled) {
    background-color: #3700b3;
}

.bg-option label[for="bg-image-input"].disabled {
    background-color: #555;
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="color"] {
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

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

.blur-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.blur-option label {
    min-width: 100px;
}

input[type="range"] {
    flex: 1;
}

/* Preview Section */
.preview-section {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.aspect-ratio-selector {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.aspect-btn {
    display: flex;
    align-items: center;
    background-color: #333;
    color: #fff;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-width: 160px;
}

.aspect-btn:hover {
    background-color: #444;
    transform: translateY(-2px);
}

.aspect-btn.active {
    background-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(98, 0, 238, 0.3);
}

.format-preview {
    width: 40px;
    height: 40px;
    background-color: #222;
    border: 2px solid #555;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.format-preview::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background-image: linear-gradient(45deg, var(--primary-light), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.format-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    background-color: #222;
    border-radius: 50%;
    z-index: 2;
}

.square-preview {
    width: 36px;
    height: 36px;
    border-radius: 4px;
}

.vertical-preview {
    width: 24px;
    height: 40px;
    border-radius: 4px;
}

.portrait-preview {
    width: 32px;
    height: 40px;
    border-radius: 4px;
}

.format-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.format-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.format-platforms {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 2px;
}

.preview-buttons {
    display: flex;
    gap: 0.5rem;
}

.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

canvas {
    background-color: #000;
    border-radius: 4px;
    max-width: 100%;
    display: block;
    height: auto !important;
    box-sizing: border-box;
}

/* Export Section */
.export-section {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.audio-option {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.audio-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.export-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.export-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--on-primary);
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.2s;
}

.export-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.export-progress {
    margin-top: 15px;
    background-color: var(--surface);
    border-radius: 4px;
    padding: 10px;
    border: 1px solid #333;
    color: var(--on-surface);
}

.progress-bar {
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50;
    width: 0%;
    transition: width 0.3s ease;
}

/* Voeg deze stijlen toe voor een betere weergave van de MP4 export knop met waarschuwing */
.export-btn.warning {
    background-color: #ffb74d;
    border: 1px solid #ff9800;
}

.export-btn.warning:hover {
    background-color: #ff9800;
}

#ffmpeg-status {
    font-family: monospace;
    font-size: 12px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animatie voor het laden */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

#progress-text {
    animation: pulse 1.5s infinite;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: var(--on-background);
    opacity: 0.7;
}

/* Crop Interface Styles */
.crop-container {
    margin-top: 1rem;
    text-align: center;
}

.crop-area {
    position: relative;
    margin: 1rem auto;
    max-width: 100%;
    max-height: 500px;
    overflow: hidden;
    background-color: #2a2a2a;
    border-radius: 4px;
}

#crop-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    cursor: move;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.crop-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.crop-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.crop-slider label {
    min-width: 110px;
    font-weight: bold;
    color: var(--primary-light);
}

.crop-slider input[type="range"] {
    flex: 1;
    max-width: 300px;
    height: 6px;
    background-color: #444;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

.crop-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background-color: var(--primary-light);
    border-radius: 50%;
    cursor: pointer;
}

.crop-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: var(--primary-light);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.crop-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Vinyl Options Styling */
.vinyl-options {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.vinyl-options h3 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.option-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.option-slider label {
    min-width: 100px;
}

.option-slider input[type="range"] {
    flex: 1;
    max-width: 300px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .canvas-container {
        padding: 0 10px;
    }
    
    canvas {
        max-width: 100%;
        height: auto !important;
        /* Explicitly preserve aspect ratio on mobile */
        aspect-ratio: attr(width) / attr(height);
    }
    
    .aspect-ratio-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .aspect-btn {
        width: 100%;
        max-width: 280px;
        margin-bottom: 0.5rem;
    }
    
    .preview-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .preview-buttons {
        align-self: center;
    }
} 