/* ============================================
   SKETCH NEKO MODEL - COMPLETE STYLESHEET
   Version: 2.0 (Restructured)
   ============================================ */

/* ----- RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: #0a0a0a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #121212;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== TOOLBAR ===== */
#toolbar {
    background: linear-gradient(180deg, #1e1e1e 0%, #161616 100%);
    padding: 10px 20px;
    display: flex;
    gap: 25px;
    align-items: flex-end;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
    min-height: 85px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tool-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-section h4 {
    color: #888;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tool-buttons {
    display: flex;
    gap: 6px;
}

.tool-btn, .mode-btn, .timeline-btn {
    background: linear-gradient(180deg, #2a2a2a 0%, #222 100%);
    color: #ddd;
    border: 1px solid #3a3a3a;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tool-btn:hover, .mode-btn:hover, .timeline-btn:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border-color: #555;
    transform: translateY(-1px);
}

.tool-btn:active, .mode-btn:active, .timeline-btn:active {
    transform: translateY(0px);
}

/* Transform Mode Buttons */
.transform-buttons {
    display: flex;
    gap: 2px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #333;
}

.mode-btn {
    min-width: 60px;
    background: #222;
}

.mode-btn.active {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    border-color: #00aaff;
    color: white;
    box-shadow: 0 0 8px rgba(0,102,204,0.5);
}

/* Danger buttons */
.danger {
    background: linear-gradient(180deg, #8b0000, #5a0000);
    border-color: #aa0000;
}

.danger:hover {
    background: linear-gradient(180deg, #aa0000, #7a0000);
}

/* ===== MAIN CONTENT ===== */
#main {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ===== PANELS ===== */
.panel {
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    display: flex;
    flex-direction: column;
    border: 1px solid #2a2a2a;
}

.panel-header {
    background: linear-gradient(180deg, #202020 0%, #181818 100%);
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    color: #eee;
    font-size: 13px;
    font-weight: 600;
}

.panel-header span {
    color: #888;
    font-size: 11px;
}

.scrollable {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.placeholder {
    color: #555;
    text-align: center;
    padding: 40px;
    font-size: 12px;
}

/* Left Panel - Hierarchy */
#hierarchy-panel {
    width: 260px;
    min-width: 260px;
    border-right: 1px solid #2a2a2a;
}

#object-list {
    padding: 8px;
}

.object-item {
    padding: 10px 12px;
    background: #1e1e1e;
    margin: 4px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.object-item:hover {
    background: #282828;
    border-color: #3a3a3a;
    transform: translateX(2px);
}

.object-item.selected {
    background: linear-gradient(135deg, #0066cc, #0088ff);
    border-color: #00aaff;
}

.object-item .object-icon {
    font-size: 14px;
    width: 20px;
}

.object-item .object-name {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
}

.object-item .eye-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.object-item .eye-btn:hover {
    background: #3a3a3a;
    color: #fff;
}

/* Right Panel - Properties */
#properties-panel {
    width: 300px;
    min-width: 300px;
    border-left: 1px solid #2a2a2a;
}

#properties {
    padding: 16px;
}

.property-group {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #282828;
}

.property-group h4 {
    color: #ccc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2a2a;
}

.property-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.property-row label {
    width: 45px;
    color: #999;
    font-size: 11px;
    font-weight: 600;
}

.property-row input[type="number"],
.property-row input[type="text"] {
    flex: 1;
    background: #252525;
    border: 1px solid #333;
    color: #eee;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.property-row input[type="number"]:focus,
.property-row input[type="text"]:focus {
    outline: none;
    border-color: #0066cc;
}

.property-row input[type="range"] {
    flex: 1;
    height: 4px;
    background: #333;
    border-radius: 2px;
    -webkit-appearance: none;
}

.property-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #0088ff;
    border-radius: 50%;
    cursor: pointer;
}

.property-row input[type="color"] {
    width: 50px;
    height: 32px;
    border: 1px solid #333;
    border-radius: 5px;
    cursor: pointer;
    background: #252525;
}

/* ===== VIEWPORT ===== */
#viewport-container {
    flex: 1;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

#viewport {
    width: 100%;
    height: 100%;
    display: block;
}

#gizmo-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #333;
    pointer-events: none;
    font-family: monospace;
}

#gizmo-mode {
    color: #00ccff;
}

#coordinates {
    color: #aaa;
    font-family: monospace;
}

#vertex-status {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff6600;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    animation: pulse 1s infinite;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; background: #ff8800; }
}

/* ===== TIMELINE (Collapsible) ===== */
#timeline {
    border-top: 1px solid #2a2a2a;
    height: auto;
    min-height: 42px;
    transition: all 0.2s ease;
}

#timeline.collapsed #timeline-content {
    display: none;
}

#timeline.collapsed {
    min-height: 42px;
}

#timeline-content {
    padding: 12px 16px;
}

#time-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

#time-display {
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    color: #00ccff;
    background: #0a0a0a;
    padding: 4px 10px;
    border-radius: 5px;
    min-width: 70px;
    text-align: center;
}

#time-slider {
    flex: 1;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    -webkit-appearance: none;
}

#time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #00ccff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px #00ccff;
}

.timeline-btn {
    padding: 6px 12px;
    font-size: 11px;
}

#timeline-track {
    background: #0f0f0f;
    border-radius: 6px;
    height: 60px;
    position: relative;
    border: 1px solid #2a2a2a;
    overflow-x: auto;
    overflow-y: visible;
}

#timeline-ruler {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
    pointer-events: none;
}

#keyframes-container {
    position: relative;
    height: 100%;
    min-height: 60px;
}

.keyframe {
    position: absolute;
    width: 12px;
    height: 24px;
    background: linear-gradient(180deg, #ff9900, #ff6600);
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    border: 1px solid #ffcc00;
    transition: all 0.1s;
    z-index: 10;
}

.keyframe:hover {
    transform: translateY(-50%) scale(1.2);
    background: linear-gradient(180deg, #ffcc00, #ff9900);
}

.keyframe.selected {
    background: linear-gradient(180deg, #00ffcc, #00ccff);
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

#playhead {
    position: absolute;
    width: 2px;
    height: 100%;
    background: #00ffff;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 15;
    box-shadow: 0 0 8px #00ffff;
}

.toggle-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.toggle-btn:hover {
    background: #2a2a2a;
    color: white;
}

/* ===== STATUSBAR ===== */
#statusbar {
    background: #111;
    padding: 6px 16px;
    border-top: 1px solid #222;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #777;
    font-family: monospace;
}

#status {
    color: #00cc66;
}

#stats, #clipboard-status, #vertex-mode-status, #fps {
    font-family: monospace;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
    #toolbar {
        gap: 15px;
        padding: 10px 12px;
    }
    
    .tool-btn, .mode-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    #hierarchy-panel {
        width: 220px;
        min-width: 220px;
    }
    
    #properties-panel {
        width: 260px;
        min-width: 260px;
    }
}

@media (max-width: 800px) {
    #toolbar {
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
    }
    
    .tool-section {
        width: 100%;
    }
    
    .tool-buttons {
        flex-wrap: wrap;
    }
    
    #main {
        flex-direction: column;
    }
    
    #hierarchy-panel, #properties-panel {
        width: 100%;
        min-width: auto;
        max-height: 200px;
    }
    
    #hierarchy-panel {
        border-bottom: 1px solid #2a2a2a;
    }
    
    #properties-panel {
        border-top: 1px solid #2a2a2a;
    }
    
    #timeline-content {
        overflow-x: auto;
    }
}

/* ===== SELECTION & FOCUS ===== */
::selection {
    background: #0066cc;
    color: white;
}

*:focus-visible {
    outline: 2px solid #0088ff;
    outline-offset: 2px;
}

/* ===== LOADING ANIMATION ===== */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== VERTEX EDITING MODE STYLES ===== */
.vertex-point {
    cursor: move;
    transition: transform 0.05s;
}

.vertex-point:hover {
    transform: scale(1.2);
}

/* ===== UTILITY ===== */
.text-muted {
    color: #666;
    font-size: 10px;
}

.monospace {
    font-family: 'Courier New', monospace;
}
