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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Brand Header */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    position: relative;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.lang-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.lang-select:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.lang-select:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.lang-select option {
    background: #1a1a2e;
    color: #fff;
    padding: 8px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(0, 212, 255, 0.3));
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #00d4ff;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.subtitle-secondary {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* Mode Tabs Container */
.mode-tabs-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-tabs-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tab Groups */
.tab-group {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-group.full-width {
    flex: 100%;
}

.tab-group-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 6px;
    padding-left: 8px;
}

.tab-group-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Mode Tab Buttons */
.mode-tab {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #888;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.mode-tab.active {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.mode-tab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mode-tab span {
    white-space: nowrap;
}

/* Responsive for mobile */
@media (max-width: 600px) {
    .tab-group {
        min-width: 100%;
    }

    .mode-tab {
        min-width: 70px;
        padding: 8px 6px;
        font-size: 0.7rem;
    }

    .mode-tab svg {
        width: 18px;
        height: 18px;
    }
}

/* Upload Area */
.upload-area {
    border: 3px dashed #444;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.upload-btn {
    display: inline-block;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 15px 0;
}

.upload-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.upload-btn.small {
    padding: 8px 20px;
    font-size: 0.85rem;
    margin: 0;
}

.file-info {
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

.file-name-display {
    color: #888;
    font-size: 0.85rem;
    margin-left: 10px;
}

/* Settings */
.settings {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
}

.settings-panel {
    animation: fadeIn 0.3s ease;
}

.settings-panel.hidden {
    display: none;
}

.settings h3 {
    margin-bottom: 20px;
    color: #00d4ff;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.setting-row.hidden {
    display: none;
}

.setting-row label {
    flex: 1;
    min-width: 150px;
}

.setting-row input[type="range"] {
    flex: 2;
    min-width: 200px;
    height: 8px;
    border-radius: 5px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    cursor: pointer;
}

.setting-row input[type="number"],
.setting-row input[type="text"],
.setting-row select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
    width: 150px;
}

.setting-row input[type="text"] {
    width: 250px;
}

.setting-row input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.setting-row select {
    cursor: pointer;
}

.setting-hint {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 5px;
}

/* Button Options (for Rotate) */
.button-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-btn {
    padding: 10px 18px;
    border: 2px solid #444;
    border-radius: 8px;
    background: transparent;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    border-color: #00d4ff;
    color: #fff;
}

.option-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    border-color: transparent;
    color: #fff;
}

/* Button Group */
.button-group {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.button-group.show {
    display: flex;
}

.process-btn {
    width: 100%;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.process-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    width: 100%;
    background: transparent;
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.reset-btn:hover svg {
    transform: rotate(180deg);
}

.reset-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* Color picker row for Remove BG */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eyedropper-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eyedropper-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.eyedropper-btn.active {
    background: rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
    color: #00d4ff;
}

.removebg-info {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

.removebg-info p {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 5px;
}

.removebg-info p:last-child {
    margin-bottom: 0;
}

/* File list preview */
.file-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    display: none;
}

.file-list.show {
    display: block;
}

.file-list h4 {
    color: #00d4ff;
    margin-bottom: 10px;
}

.file-list ul {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.file-list li {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list li .file-size {
    color: #888;
    font-size: 0.85rem;
}

.file-list li .file-size.large-file {
    color: #f59e0b;
}

/* Crop Preview */
.crop-preview {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.crop-preview.hidden {
    display: none;
}

.crop-preview h4 {
    color: #00d4ff;
    margin-bottom: 15px;
}

.crop-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.crop-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
    overflow: hidden;
}

.crop-wrapper img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    user-select: none;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px dashed #00d4ff;
    background: transparent;
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #00d4ff;
    border-radius: 50%;
    z-index: 11;
}

.crop-handle.nw { top: -7px; left: -7px; cursor: nw-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: ne-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: sw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: se-resize; }

.crop-info {
    text-align: center;
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
}

/* Results */
.results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.results-header h3 {
    color: #00d4ff;
}

.results-summary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.results-summary .stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.results-summary .stat span {
    color: #4ade80;
    font-weight: bold;
}

.results-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease;
}

.result-item:last-child {
    border-bottom: none;
}

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

.result-item .file-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-item .file-name {
    font-weight: 500;
    word-break: break-all;
    color: #fff;
}

.result-item .info-tag {
    display: inline-block;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.result-item .info-tag.info {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.result-item .size-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #888;
}

.result-item .size-info .arrow {
    color: #00d4ff;
}

.result-item .size-info .new-size {
    color: #fff;
}

.result-item .reduction {
    color: #4ade80;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

.result-item .reduction.increase {
    color: #ef4444;
}

.result-item .reduction.same {
    color: #888;
}

.result-item .preview-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s ease;
}

.result-item .preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.result-item .download-btn-small {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    color: #000;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.result-item .download-btn-small:hover {
    transform: scale(1.05);
}

@media (max-width: 700px) {
    .result-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-item .size-info,
    .result-item .reduction,
    .result-item .preview-btn,
    .result-item .download-btn-small {
        justify-self: start;
    }
}

/* Download All */
.download-all-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    background: linear-gradient(90deg, #7b2ff7, #00d4ff);
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-all-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(123, 47, 247, 0.4);
}

.download-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Preview Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h4 {
    color: #00d4ff;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.modal-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .modal-comparison {
        grid-template-columns: 1fr;
    }
}

.modal-comparison .compare-item {
    text-align: center;
}

.modal-comparison .compare-item h5 {
    margin-bottom: 10px;
    color: #888;
}

.modal-comparison .compare-item img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    object-fit: contain;
    background: #111;
}

/* Filter Grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 15px 10px;
    border: 2px solid #444;
    border-radius: 10px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #00d4ff;
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    border-color: transparent;
    color: #fff;
}

.filter-icon {
    font-size: 1.5rem;
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid #444;
    border-radius: 10px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    border-color: #00d4ff;
    color: #fff;
}

.preset-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    border-color: transparent;
    color: #fff;
}

.preset-icon {
    font-size: 1.3rem;
}

.preset-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.preset-size {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Metadata Info */
.metadata-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.metadata-info p {
    margin-bottom: 10px;
    color: #aaa;
}

.metadata-info ul {
    list-style: none;
    padding-left: 10px;
}

.metadata-info li {
    padding: 5px 0;
    color: #888;
    font-size: 0.9rem;
}

.metadata-info li::before {
    content: "✓ ";
    color: #4ade80;
}

/* Twibbon Preview */
.twibbon-preview-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.twibbon-preview-container h4 {
    color: #00d4ff;
    margin-bottom: 15px;
}

.twibbon-canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 20px 20px;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    overflow: hidden;
}

.twibbon-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.twibbon-controls {
    margin-top: 15px;
}

.reset-position-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #444;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.reset-position-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00d4ff;
}

/* Animation Feature Styles */
.animate-step {
    margin-bottom: 20px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* Rig Editor */
.rig-editor-container {
    display: flex;
    gap: 15px;
    margin: 15px 0;
}

.rig-canvas-wrapper {
    flex: 1;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 20px 20px;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    position: relative;
    cursor: crosshair;
}

.rig-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 350px;
}

.rig-joints-list {
    width: 140px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    max-height: 350px;
    overflow-y: auto;
}

.joint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.joint-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.joint-item.active {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.joint-item.placed {
    color: #4ade80;
}

.joint-item.placed .joint-dot {
    background: #4ade80;
}

.joint-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
    border: 2px solid #666;
}

.rig-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.rig-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.rig-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rig-btn.primary {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
}

.rig-btn.primary:hover {
    transform: scale(1.02);
}

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

/* Animation Presets */
.animation-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.anim-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.anim-preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.anim-preset-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: #00d4ff;
    color: #00d4ff;
}

.anim-icon {
    font-size: 1.5rem;
}

/* Animation Preview */
.anim-preview-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.anim-preview-container h4 {
    color: #00d4ff;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.preview-mode-toggle {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    justify-content: center;
}

.preview-mode-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.preview-mode-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: #00d4ff;
    color: #00d4ff;
}

.anim-preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 20px 20px;
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
}

.anim-preview-wrapper canvas {
    max-width: 100%;
    max-height: 250px;
}

.anim-preview-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.play-btn, .stop-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.play-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #000;
}

.play-btn:hover {
    transform: scale(1.02);
}

.stop-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.stop-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.back-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    border-color: #00d4ff;
    color: #00d4ff;
}

/* Direction Selector */
.direction-selector {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.direction-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.direction-label {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
}

.direction-info {
    position: relative;
    display: flex;
    align-items: center;
    color: #666;
    cursor: help;
}

.direction-info:hover .info-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.info-tooltip {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(5px);
    width: 250px;
    padding: 10px 12px;
    background: #1a1a2e;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    margin-bottom: 8px;
}

.direction-tabs {
    display: flex;
    gap: 10px;
}

.direction-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.direction-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.direction-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(123, 47, 247, 0.15) 100%);
    border-color: rgba(0, 212, 255, 0.5);
    color: #fff;
}

.direction-tab.complete {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.direction-tab.complete .direction-status {
    background: #4ade80;
    color: #000;
}

.direction-tab svg {
    flex-shrink: 0;
}

.direction-status {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.7rem;
    color: #888;
}

.direction-tab.active .direction-status {
    background: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

.direction-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #f59e0b;
    line-height: 1.4;
}

.note-icon {
    flex-shrink: 0;
}

/* Side View Guide */
.sideview-guide {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    align-items: center;
}

@media (max-width: 500px) {
    .sideview-guide {
        flex-direction: column;
        text-align: center;
    }
}

.guide-visual {
    flex-shrink: 0;
}

.sideview-svg {
    width: 140px;
    height: 200px;
    transition: transform 0.3s ease;
}

.guide-text {
    flex: 1;
}

.guide-text p {
    color: #00d4ff;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.guide-text ul {
    list-style: none;
    padding: 0;
}

.guide-text li {
    font-size: 0.85rem;
    color: #aaa;
    padding: 4px 0;
    padding-left: 15px;
    position: relative;
}

.guide-text li::before {
    content: "•";
    color: #00d4ff;
    position: absolute;
    left: 0;
}

/* Animate Upload Area */
.animate-upload-area {
    margin: 15px 0;
}

.animate-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(123, 47, 247, 0.05) 100%);
    border: 2px dashed rgba(0, 212, 255, 0.4);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.animate-upload-dropzone:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(123, 47, 247, 0.1) 100%);
    border-color: rgba(0, 212, 255, 0.7);
    transform: translateY(-2px);
}

.animate-upload-dropzone.dragover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(123, 47, 247, 0.15) 100%);
    border-color: #00d4ff;
    border-style: solid;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.animate-upload-dropzone .dropzone-icon {
    width: 50px;
    height: 50px;
    color: #00d4ff;
    opacity: 0.8;
}

.animate-upload-dropzone .dropzone-icon svg {
    width: 100%;
    height: 100%;
}

.animate-upload-dropzone .dropzone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.animate-upload-dropzone .dropzone-main {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.animate-upload-dropzone .dropzone-sub {
    font-size: 0.85rem;
    color: #888;
}

.dropzone-part-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    margin-top: 5px;
}

.dropzone-part-label span:first-child {
    font-size: 0.85rem;
    color: #888;
}

.part-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 100%);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.part-badge.all-done {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

/* Body Parts Upload Grid */
.body-parts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 15px 0;
}

/* 10 parts grid - 5 columns for better layout */
.body-parts-grid.body-parts-10 {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

@media (max-width: 700px) {
    .body-parts-grid.body-parts-10 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 500px) {
    .body-parts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .body-parts-grid.body-parts-10 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Part group labels */
.part-group-label {
    grid-column: span 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-top: 5px;
}

@media (max-width: 700px) {
    .part-group-label {
        grid-column: span 4;
    }
}

@media (max-width: 500px) {
    .part-group-label {
        grid-column: span 2;
    }
}

.group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00d4ff;
}

.group-hint {
    font-size: 0.7rem;
    color: #666;
    font-style: italic;
}

/* Depth tags */
.depth-tag {
    display: inline-block;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 6px;
    margin-left: 3px;
    font-weight: 500;
}

.depth-tag.front {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.depth-tag.back {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Part front/back visual distinction */
.body-part-item.part-back {
    opacity: 0.8;
}

.body-part-item.part-back .part-preview {
    background: rgba(0, 0, 0, 0.4);
}

.body-part-item.part-front .part-preview {
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.body-part-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed #444;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.body-part-item:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.body-part-item.uploaded {
    border-style: solid;
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.part-preview {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.part-preview svg {
    width: 50px;
    height: 50px;
    color: #666;
}

.part-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.body-part-item.uploaded .part-preview svg {
    display: none;
}

.part-label {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

.part-status {
    font-size: 0.65rem;
    color: #555;
    font-style: italic;
    margin-top: -4px;
}

.body-part-item.uploaded .part-label {
    color: #4ade80;
}

.body-part-item.uploaded .part-status {
    color: #4ade80;
}

.body-part-item.selecting {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    animation: pulse-border 1.5s infinite;
}

.body-part-item.selecting .part-status {
    color: #00d4ff;
    font-weight: 500;
}

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(0, 212, 255, 0); }
}

/* Current Part Selection */
.current-part-selection {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 47, 247, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.selection-label {
    color: #00d4ff;
    font-size: 0.9rem;
}

.selected-part-name {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.part-upload-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-size: 0.75rem;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.part-upload-btn:hover {
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    color: #fff;
}

.body-part-item.uploaded .part-upload-btn {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

/* Parts Status */
.parts-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.status-text {
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
}

.status-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.status-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #4ade80);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Assembly Container */
.assembly-container {
    display: flex;
    gap: 15px;
    margin: 15px 0;
}

@media (max-width: 700px) {
    .assembly-container {
        flex-direction: column;
    }
}

.assembly-canvas-wrapper {
    flex: 1;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 20px 20px;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    position: relative;
}

.assembly-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 400px;
    cursor: pointer;
}

.assembly-controls {
    width: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
}

.assembly-controls h4 {
    color: #00d4ff;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.selected-part-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.selected-part-info .no-selection {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

.selected-part-info .part-name {
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
}

.pivot-controls .control-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.pivot-controls label {
    font-size: 0.75rem;
    color: #888;
}

.pivot-controls input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #333;
    -webkit-appearance: none;
}

.pivot-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
}

.pivot-controls span {
    font-size: 0.75rem;
    color: #00d4ff;
    text-align: right;
}

.layer-order {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.layer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.75rem;
    color: #aaa;
    cursor: grab;
}

.layer-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
}

.layer-item.selected {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.layer-item .layer-arrows {
    display: flex;
    gap: 2px;
}

.layer-item .layer-arrows button {
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-item .layer-arrows button:hover {
    background: #00d4ff;
    color: #000;
}

.assembly-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* Hidden utility */
.hidden {
    display: none !important;
}
