/* Modern Dark Theme for Video Editor */
.container {
    max-width: 100%;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
}

/* Scrollable Controls Container */
.controls-container {
    max-height: 50vh;
    overflow-y: auto;
    padding: 1rem;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #00aaff #333;
}

.controls-container::-webkit-scrollbar {
    width: 8px;
}

.controls-container::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.controls-container::-webkit-scrollbar-thumb {
    background: #00aaff;
    border-radius: 4px;
}

.controls-container::-webkit-scrollbar-thumb:hover {
    background: #0088cc;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
        font-weight: 700;
        font-family: 'Montserrat', sans-serif;
    }
    h2 {
        font-size: 1.25rem;
        font-weight: 600;
        font-family: 'Poppins', sans-serif;
    }
    #previewCanvas, #previewOutput {
        max-height: 40vh;
        border-radius: 8px;
    }
    .controls-container {
        max-height: 45vh;
    }
}

@media (min-width: 641px) {
    #previewCanvas, #previewOutput {
        max-height: 50vh;
        border-radius: 8px;
    }
    .controls-container {
        max-height: 50vh;
    }
}

/* Loading Spinner */
.loader {
    border: 6px solid #333;
    border-top: 6px solid #00aaff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Upload Loading */
#uploadLoading {
    font-size: 1rem;
    font-weight: 500;
    color: #00aaff;
    font-family: 'Roboto', sans-serif;
}

/* Retry Button */
#retryUpload {
    font-size: 0.9rem;
    background: #00aaff;
    transition: background-color 0.3s ease;
}

#retryUpload:hover {
    background: #0088cc;
}

/* Advanced Mode Layer Styles */
#layerPanel {
    max-height: 150px;
    overflow-y: auto;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px;
}

.layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 4px 0;
    background: #333;
    border: 1px solid #666;
    border-radius: 6px;
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
}

.layer-item button {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #00aaff;
    color: #fff;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.layer-item button:hover {
    background: #0088cc;
}

/* Name Stripe Controls */
#stripeControls {
    padding-left: 1.25rem;
    border-left: 2px solid #444;
}

/* Drag Handle */
.drag-handle {
    font-size: 1.1rem;
    color: #aaa;
    user-select: none;
    transition: color 0.3s ease;
}

.drag-handle:hover {
    color: #fff;
}

/* Mobile Touch Enhancements */
.touch-label {
    display: block;
    padding: 10px 0;
    min-height: 48px;
    line-height: 1.6;
    font-family: 'Poppins', sans-serif;
    color: #e0e0e0;
}

.touch-select, .touch-button, .touch-checkbox, .touch-range, .touch-color {
    min-height: 48px;
    padding: 10px;
    touch-action: manipulation;
    border-radius: 6px;
}

.touch-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #333 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="%23aaa" d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
    background-size: 12px;
    color: #e0e0e0;
    border: 1px solid #555;
}

.touch-button {
    background: #00aaff;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.touch-button:hover {
    background: #0088cc;
}

.touch-checkbox {
    width: 22px;
    height: 22px;
    accent-color: #00aaff;
}

.touch-range {
    height: 48px;
    accent-color: #00aaff;
}

.touch-color {
    height: 48px;
    padding: 6px;
    border: 1px solid #555;
}

/* File input labels */
label[for="mediaInput"],
label[for="userPhoto"],
label[for="customFrameImage"] {
    display: block;
    min-height: 48px;
    line-height: 48px;
    background: #00aaff;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

label[for="mediaInput"]:hover,
label[for="userPhoto"]:hover,
label[for="customFrameImage"]:hover {
    background: #0088cc;
}

/* Name Stripe Preview */
.name-stripe-preview {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #00aaff, #66ccff);
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
    height: 90px;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.name-stripe-preview .photo-area {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    border: 2px solid #333;
}

.name-stripe-preview .photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name-stripe-preview .name-area {
    flex: 1;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.name-stripe-preview .name-area div {
    text-align: left;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Additional UI Enhancements */
h1 {
    font-family: 'Montserrat', sans-serif;
    color: #00aaff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

h2, h3 {
    font-family: 'Poppins', sans-serif;
    color: #e0e0e0;
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
    background: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Roboto', sans-serif;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: #00aaff;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
}

/* Canvas Border */
#previewCanvas, #previewOutput {
    border: 1px solid #444;
    background: #222;
}