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

main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    overflow-x: hidden;
    overflow-y: scroll;
}

h1 {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-size: 48px;
}

.by-text {
    display: block;
    font-size: 16px;
    font-weight: normal;
}

h1 a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

h1 a:hover {
    opacity: 0.85;
}

.upload-area {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 30px;
    max-width: 600px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.upload-area:hover {
    border-color: #888;
    background: #111;
}

.upload-area.dragover {
    border-color: #fff;
    background: #222;
}

.upload-area.hide {
    display: none;
}

.upload-text {
    font-size: 18px;
    margin-bottom: 10px;
}

input[type="file"] {
    display: none;
}

.btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin: 5px;
}

.btn:hover {
    background: #555;
}

.btn.active {
    background: #fff;
    color: #000;
}

.format-section {
    margin-top: 20px;
}

.format-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.format-label {
    font-size: 16px;
}

.btn-toggle {
    padding: 8px 16px;
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-toggle:hover {
    background: #fff;
    color: #000;
}

@media (prefers-color-scheme: light) {
    .btn-toggle {
        color: #000;
        border-color: #000;
    }
    
    .btn-toggle:hover {
        background: #000;
        color: #fff;
    }
}

.format-buttons {
    display: none !important;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow: hidden !important;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.format-buttons.show {
    display: flex !important;
    max-height: 200px !important;
    opacity: 1 !important;
}

.format-description {
    margin: 0;
    font-size: 14px;
    color: #fff;
}

@media (prefers-color-scheme: light) {
    .format-description {
        color: #000;
    }
}

.format-btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.preview-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.preview-container.show {
    display: flex;
}

video {
    max-width: 100%;
    max-height: 60vh;
    border: 1px solid #555;
    border-radius: 8px;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.execute-btn {
    background: #fff;
    color: #000;
    font-weight: bold;
    padding: 16px 48px;
    font-size: 18px;
}

.execute-btn:hover {
    background: #ddd;
}

.execute-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.execute-btn:disabled:hover {
    background: #333;
}

.reset-btn {
    background: #555;
    padding: 16px 32px;
    font-size: 18px;
}

.reset-btn:hover {
    background: #666;
}

.progress-container {
    display: none;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.progress-container.show {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.3s;
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

.progress-text {
    font-size: 14px;
    color: #999;
}

@media (max-width: 768px) {
    .header-title {
        font-size: 36px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 90%;
        max-width: 90vw;
        margin: 0 auto;
    }
    
    .execute-btn, .reset-btn {
        width: 100%;
        padding: 18px;
    }
}

@media (prefers-color-scheme: light) {
    body {
        background: #f5f5f5;
        color: #000;
    }
    
    .upload-area {
        border-color: #ccc;
    }
    
    .upload-area:hover {
        border-color: #999;
        background: #e8e8e8;
    }
    
    .upload-area.dragover {
        border-color: #666;
        background: #ddd;
    }
    
    .btn {
        background: #e0e0e0;
        color: #000;
    }
    
    .btn:hover {
        background: #d0d0d0;
    }
    
    .btn.active {
        background: #333;
        color: #fff;
    }
    
    video {
        border-color: #ccc;
    }
    
    .execute-btn {
        background: #333;
        color: #fff;
    }
    
    .execute-btn:hover {
        background: #555;
    }
    
    .execute-btn:disabled {
        background: #e0e0e0;
        color: #999;
    }
    
    .execute-btn:disabled:hover {
        background: #e0e0e0;
    }
    
    .reset-btn {
        background: #e0e0e0;
        color: #000;
    }
    
    .reset-btn:hover {
        background: #d0d0d0;
    }
    
    .progress-bar {
        background: #ddd;
    }
    
    .progress-bar::after {
        background: #333;
    }
    
    .progress-text {
        color: #666;
    }
}
