* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: #e4e4e7;
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
}

.logo img {
    height: 32px;
    width: auto;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #a1a1aa;
    font-size: 1rem;
}

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Sections */
section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.25rem;
    color: #f4f4f5;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Drop Zone */
.drop-section {
    margin-bottom: 40px;
}

.drop-zone {
    border: 2px dashed rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(34, 197, 94, 0.02);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(34, 197, 94, 0.05);
}

.drop-icon {
    color: #22c55e;
    margin-bottom: 16px;
}

.drop-text {
    font-size: 1.1rem;
    color: #f4f4f5;
    margin-bottom: 8px;
}

.drop-hint {
    color: #71717a;
    font-size: 0.9rem;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.file-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon.dff {
    background: linear-gradient(135deg, #6366f1, #818cf8);
}

.file-icon.txd {
    background: linear-gradient(135deg, #a855f7, #c084fc);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.9rem;
    color: #f4f4f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: #71717a;
}

.file-remove {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.settings-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
}

.settings-card h3 {
    font-size: 1rem;
    color: #f4f4f5;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-card h3 svg {
    color: #22c55e;
}

.setting-row {
    margin-bottom: 16px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    display: block;
    font-size: 0.85rem;
    color: #a1a1aa;
    margin-bottom: 6px;
}

.setting-row select,
.setting-row input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f4f4f5;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.setting-row select:focus,
.setting-row input[type="number"]:focus {
    border-color: #22c55e;
}

.setting-row select option {
    background: #1a1a2e;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
}

/* Reduction Slider */
.reduction-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.reduction-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reduction-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.reduction-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #22c55e;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

#reductionValue {
    color: #22c55e;
    font-weight: 600;
}

/* Reduction Warning */
.reduction-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 0.8rem;
}

.reduction-warning svg {
    flex-shrink: 0;
    color: #f59e0b;
}

/* LOD Levels */
.lod-levels {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lod-level {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.lod-label {
    width: 80px;
    font-size: 0.85rem;
    color: #a1a1aa;
}

.lod-triangles {
    width: 100px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #f4f4f5;
    font-size: 0.85rem;
}

.lod-suffix {
    font-size: 0.8rem;
    color: #71717a;
}

/* Generate Button */
.generate-section {
    text-align: center;
    margin-top: 30px;
}

.generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #22c55e, #10b981);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress */
.progress-section {
    text-align: center;
    padding: 40px 0;
}

.progress-bar {
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #10b981);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    color: #a1a1aa;
    font-size: 0.9rem;
}

/* Preview */
.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}

.preview-pane {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.preview-pane h3 {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #a1a1aa;
    background: rgba(0, 0, 0, 0.2);
    margin: 0;
}

.preview-canvas-container {
    aspect-ratio: 16/9;
    background: #0a0a0f;
}

.preview-canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-stats {
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #71717a;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.preview-stats span {
    color: #a1a1aa;
}

.preview-stats strong {
    color: #22c55e;
}

.preview-hint {
    text-align: center;
    color: #71717a;
    font-size: 0.8rem;
    margin-top: 12px;
}

/* Results */
.results-summary {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.summary-stat {
    text-align: center;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.summary-label {
    font-size: 0.85rem;
    color: #a1a1aa;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
}

.result-card h4 {
    font-size: 0.9rem;
    color: #f4f4f5;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-card .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.badge.dff {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.badge.txd {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
}

.result-details {
    font-size: 0.8rem;
    color: #71717a;
}

.result-reduction {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.result-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #f4f4f5;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.result-download:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Download All Button */
.download-section {
    text-align: center;
    margin-top: 30px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #71717a;
    font-size: 0.9rem;
}

footer a {
    color: #6366f1;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    header {
        padding: 30px 16px 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 30px 16px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .results-summary {
        flex-direction: column;
        gap: 16px;
    }
}
