* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: #e0e0ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #a78bfa;
}

header p {
    color: #94a3b8;
    margin-top: 0.3rem;
}

/* Controls */
.controls {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-btn {
    background: #6d28d9;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(109, 40, 217, 0.3);
}

.upload-btn input {
    display: none;
}

/* Toggle */
.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px;
}

.toggle-label {
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label span {
    font-weight: 500;
}

input[type="radio"] {
    display: none;
}

input[type="radio"]:checked + span {
    color: white;
    background: #4f46e5;
    padding: 8px 20px;
    border-radius: 8px;
}

/* Save Button */
.save-btn {
    background: #22c55e;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    overflow: hidden;
}

.zip-panel, .editor-panel {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.zip-panel {
    flex: 1;
    min-width: 320px;
}

.editor-panel {
    flex: 2;
}

h2 {
    margin-bottom: 1rem;
    color: #c4d0ff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Zip Content */
.zipContent {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 0.5rem;
    overflow-y: auto;
    font-size: 0.95rem;
}

.zipContent > button {
    width: 100%;
    padding: 12px 16px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e0e0ff;
    text-align: left;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.zipContent > button:hover {
    background: #6366f1;
    transform: translateX(4px);
}

/* Tree View */
.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin: 1px 0;
    border-radius: 6px;
    cursor: pointer;
    color: #e0e0ff;
    user-select: none;
    transition: background 0.15s ease;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item:hover {
    background: rgba(99, 102, 241, 0.25);
}

.tree-item.selected {
    background: #4f46e5;
    color: #fff;
}

.tree-chevron {
    width: 10px;
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.tree-chevron.rotated {
    transform: rotate(90deg);
}

.tree-chevron-spacer {
    display: inline-block;
    width: 10px;
}

.tree-icon {
    width: 16px;
    text-align: center;
    font-size: 0.95rem;
}

.folder-icon {
    color: #fbbf24;
}

.file-icon {
    color: #a5b4fc;
}

.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-children.collapsed {
    display: none;
}

/* Editor */
.value {
    flex: 1;
    background: #0a0a1f;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: #e0f2fe;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    padding: 1rem;
    resize: none;
    outline: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

/* Responsive */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
    .controls {
        flex-direction: column;
    }
}