:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(23, 31, 50, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent-1: #6366f1;
    --accent-2: #ec4899;
    --accent-3: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-family: 'Inter', sans-serif;
    --border-radius: 16px;
    --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Shapes for Premium Look */
.bg-shape {
    position: absolute;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    border-radius: 50%;
    animation: float 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-1);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-2);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-3);
    top: 40%;
    left: 40%;
    opacity: 0.3;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* App Container (Glassmorphism) */
.app-container {
    width: 100%;
    max-width: 1000px;
    margin: 40px 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.logo i {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-weight: 700;
    font-size: 2.2rem;
}

.logo .highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Upload Area */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: fadeIn 0.5s ease-out;
}

.drop-zone {
    width: 100%;
    max-width: 600px;
    height: 300px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.upload-icon {
    font-size: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: scale(1.1);
}

.drop-zone h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.drop-zone p {
    color: var(--text-muted);
    text-align: center;
    max-width: 80%;
}

.features-preview {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.05);
}

.feature-item i {
    color: var(--accent-2);
}

/* Editor Area */
.editor {
    display: flex;
    flex-direction: column;
    gap: 25px;
    animation: fadeIn 0.5s ease-out;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
    flex-wrap: wrap;
    gap: 20px;
}

.controls-group {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.number-input {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.number-input input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 50px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-family);
}

.number-input input:focus {
    outline: none;
}

.number-input input[type="number"]::-webkit-inner-spin-button,
.number-input input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.select-input {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    padding: 0 10px;
    height: 38px;
}

.select-input select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    outline: none;
}

.select-input select option {
    background: #171f32;
    color: #f8fafc;
}

.btn-icon {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.15);
}

.actions-group {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.mt-4 {
    margin-top: 1rem;
}

/* Preview Canvas */
.preview-container {
    width: 100%;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

canvas {
    max-width: 100%;
    max-height: 60vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 4px;
}

/* Video Preview */
#preview-video {
    max-width: 100%;
    max-height: 60vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 4px;
    object-fit: contain;
}

/* File Type Badge */
.file-type-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.1);
}

.file-type-badge.badge-image {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.3);
}

.file-type-badge.badge-video {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.3);
}

/* Progress Bar */
.progress-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 18px 22px;
    border: 1px solid var(--panel-border);
    animation: fadeIn 0.3s ease-out;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.progress-info #progress-label {
    color: var(--text-muted);
    font-weight: 500;
}

.progress-info #progress-percent {
    color: var(--text-main);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient);
    border-radius: 8px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toggle Switch Text Inside */
.toggle-switch-text {
    position: relative;
    display: inline-block;
    width: 95px;
    height: 36px;
    margin-top: 2px;
}

.toggle-switch-text input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-text .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.05);
    transition: .4s;
    border-radius: 36px;
    border: 1px solid rgba(255,255,255,0.1);
}

.toggle-switch-text .slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.toggle-switch-text input:checked + .slider {
    background: var(--gradient);
    border-color: transparent;
}

.toggle-switch-text input:checked + .slider:before {
    transform: translateX(59px);
}

.toggle-switch-text .on, .toggle-switch-text .off {
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toggle-switch-text .on {
    left: 12px;
    opacity: 0;
}

.toggle-switch-text .off {
    right: 12px;
    opacity: 1;
    color: var(--text-muted);
}

.toggle-switch-text input:checked + .slider .on {
    opacity: 1;
}

.toggle-switch-text input:checked + .slider .off {
    opacity: 0;
}

@media (max-width: 768px) {
    .app-container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions-group {
        justify-content: stretch;
    }
    
    .actions-group button {
        flex: 1;
        justify-content: center;
    }
}

