/**
 * InspectorPanel Styles - Slide-up property editor
 * Part of REFACTOR_TOPLEFT_MENU (tldraw-style UI)
 */

/* ========================================
   INSPECTOR PANEL CONTAINER
   Right-side panel with right-to-left slide animation
   ======================================== */
#inspector-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(100%);
    width: 300px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    background: rgba(36, 36, 36, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: none;
    border-radius: 16px 0 0 16px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

/* Visible state - slide in from right */
#inspector-panel[data-visible="true"] {
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
    opacity: 1;
}

/* ========================================
   HEADER
   ======================================== */
.inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(28, 28, 28, 0.6);
    flex-shrink: 0;
}

.inspector-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.inspector-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
    padding: 0;
}

.inspector-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.inspector-close:active {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   CONTENT AREA
   ======================================== */
.inspector-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    overscroll-behavior: contain;
}

/* Custom scrollbar */
.inspector-content::-webkit-scrollbar {
    width: 6px;
}

.inspector-content::-webkit-scrollbar-track {
    background: transparent;
}

.inspector-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.inspector-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   PAGES
   ======================================== */
.inspector-page {
    display: none;
}

.inspector-page[style*="display: block"] {
    display: block;
}

/* ========================================
   SECTIONS
   ======================================== */
.inspector-section {
    margin-bottom: 16px;
}

.inspector-section:last-child {
    margin-bottom: 0;
}

.inspector-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* ========================================
   INPUTS
   ======================================== */
.inspector-input,
.inspector-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.inspector-input:focus,
.inspector-textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(74, 144, 217, 0.6);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.inspector-input::placeholder,
.inspector-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.inspector-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
}

/* ========================================
   SLIDERS
   ======================================== */
.inspector-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.inspector-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a90d9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.inspector-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.inspector-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a90d9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================
   TOGGLE GROUPS
   ======================================== */
.inspector-toggle-group,
.inspector-shape-group {
    display: flex;
    gap: 6px;
}

.inspector-toggle-btn,
.inspector-shape-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inspector-toggle-btn:hover,
.inspector-shape-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.inspector-toggle-btn.selected,
.inspector-shape-btn.selected {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}

/* ========================================
   COLOR GRID (for Node/Container hue)
   ======================================== */
.inspector-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.inspector-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.inspector-color-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.inspector-color-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ========================================
   COLOR ROW (for Edge color)
   ======================================== */
.inspector-color-row {
    display: flex;
    gap: 6px;
}

.inspector-color-row .inspector-color-swatch {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* ========================================
   MEMBERS INFO (Container)
   ======================================== */
.inspector-members-info {
    display: block;
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    text-align: center;
}

/* ========================================
   ACTION BUTTONS
   ======================================== */
.inspector-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.inspector-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inspector-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.inspector-btn:active {
    background: rgba(255, 255, 255, 0.16);
}

.inspector-btn-danger {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.inspector-btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

/* ========================================
   RESPONSIVE - Mobile: slide up from bottom
   ======================================== */
@media (max-width: 600px) {
    #inspector-panel {
        width: 100%;
        max-width: 100%;
        max-height: 60vh;
        top: auto;
        bottom: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: none;
        transform: translateY(100%);
    }
    
    #inspector-panel[data-visible="true"] {
        transform: translateY(0);
    }
}
