/* ============================================
   Property Inspector - Design System Styles
   ============================================ */

.property-inspector {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
}

/* ==================== Property Row ==================== */
.property-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    background: transparent;
    gap: 8px;
    overflow: visible;
    border-bottom: 1px solid #2a2a2a;
}

.property-field:hover {
    background: rgba(255, 255, 255, 0.02);
}

.property-field:last-child {
    border-bottom: none;
}

/* ==================== Property Label ==================== */
.property-label {
    flex: 0 0 35%;
    min-width: 80px;
    max-width: 140px;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin: 0;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-controlled-icon {
    color: var(--color-text-muted);
    opacity: 0.6;
    display: flex;
    align-items: center;
}

.property-label-draggable {
    cursor: ew-resize;
}

/* ==================== Property Input ==================== */
.property-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    padding: 0 8px;
    color: #ddd;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
    min-width: 0;
    height: 22px;
    transition: border-color 0.15s ease;
}

.property-input:hover {
    border-color: #4a4a4a;
    background: #1e1e1e;
}

.property-input:focus {
    outline: none;
    border-color: #d4a029;
    background: #1e1e1e;
    box-shadow: none;
}

.property-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #1a1a1a;
}

.property-input-number,
.property-input-text {
    text-align: left;
}

/* Hide number spinners */
.property-input-number::-webkit-inner-spin-button,
.property-input-number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"].property-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ==================== Custom Dropdown ==================== */
.property-dropdown {
    flex: 1;
    position: relative;
    min-width: 0;
}

.property-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    padding: 0 8px;
    color: #ddd;
    font-size: 11px;
    cursor: pointer;
    height: 22px;
    transition: border-color 0.15s ease;
}

.property-dropdown-trigger:hover {
    border-color: #4a4a4a;
}

.property-dropdown-trigger.open {
    border-color: #d4a029;
}

.property-dropdown-trigger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.property-dropdown-value {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.property-dropdown-arrow {
    margin-left: 4px;
    font-size: 10px;
    color: #666;
}

.property-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.property-dropdown-item {
    width: 100%;
    display: block;
    padding: 6px 8px;
    background: none;
    border: none;
    color: #ddd;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.property-dropdown-item:hover {
    background: #3a3a3a;
}

.property-dropdown-item.selected {
    background: #4a4a4a;
    color: #fff;
}

/* ==================== Boolean Toggle ==================== */
.property-field-boolean {
    justify-content: space-between;
}

.property-toggle {
    position: relative;
    width: 36px;
    height: 18px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.property-toggle-off {
    background: #2a2a2a;
    border: 1px solid #444;
}

.property-toggle-off:hover:not(:disabled) {
    background: #333;
    border-color: #555;
}

.property-toggle-on {
    background: #3b82f6;
    border: 1px solid #3b82f6;
}

.property-toggle-on:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.property-toggle:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.property-toggle-thumb {
    position: absolute;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.property-toggle-off .property-toggle-thumb {
    left: 2px;
    transform: translateX(0);
}

.property-toggle-on .property-toggle-thumb {
    left: 2px;
    transform: translateX(18px);
}

/* ==================== Color Field ==================== */
.property-color-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.property-color-preview {
    flex: 1;
    height: 22px;
    border-radius: 2px;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.property-color-preview:hover {
    border-color: #4a4a4a;
}

.property-input-color {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.property-input-color-text {
    width: 80px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Consolas', 'Monaco', monospace;
    text-align: center;
}

/* Color Picker Popup */
.color-picker-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    width: 200px;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.color-picker-saturation {
    position: relative;
    width: 100%;
    height: 120px;
    border-radius: 4px;
    cursor: crosshair;
    overflow: hidden;
}

.color-picker-saturation-white {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.color-picker-saturation-black {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000, transparent);
}

.color-picker-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-picker-hue {
    position: relative;
    width: 100%;
    height: 12px;
    margin-top: 8px;
    border-radius: 6px;
    background: linear-gradient(to right,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%
    );
    cursor: pointer;
}

.color-picker-hue-cursor {
    position: absolute;
    top: 50%;
    width: 6px;
    height: 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.color-picker-preview-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #3a3a3a;
}

.color-picker-preview-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #444;
    flex-shrink: 0;
}

.color-picker-hex {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #999;
    letter-spacing: 0.05em;
}

/* ==================== Asset Field ==================== */
.property-asset-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.property-asset-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Asset Thumbnail */
.property-asset-thumbnail {
    width: 44px;
    height: 44px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.property-asset-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.property-asset-thumbnail-placeholder {
    color: #555;
    font-size: 18px;
}

/* Asset Dropdown */
.property-asset-dropdown {
    flex: 1;
    display: flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    min-width: 0;
}

.property-asset-dropdown:hover {
    border-color: #4a4a4a;
}

.property-asset-dropdown.has-value {
    /* Style when has value */
}

.property-asset-text {
    flex: 1;
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.property-asset-dropdown.has-value .property-asset-text {
    color: #ddd;
    font-style: normal;
}

.property-asset-dropdown-arrow {
    margin-left: 4px;
    color: #666;
    flex-shrink: 0;
}

/* Asset Action Buttons */
.property-asset-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.property-asset-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.property-asset-btn:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #ccc;
}

/* Legacy asset drop styling */
.property-asset-drop {
    flex: 1;
    display: flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    min-width: 0;
}

.property-asset-drop:hover {
    border-color: #4a4a4a;
}

.property-asset-drop.dragging {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.property-asset-drop.has-value .property-asset-text {
    color: #ddd;
    font-style: normal;
}

.property-asset-drop.controlled {
    opacity: 0.6;
    cursor: not-allowed;
}

.property-asset-clear {
    width: 16px;
    height: 16px;
    margin-left: 4px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.property-asset-drop:hover .property-asset-clear {
    opacity: 1;
}

.property-asset-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #999;
}

.property-asset-btn-create {
    color: #4ade80;
    font-weight: bold;
    font-size: 14px;
}

.property-asset-btn-create:hover {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

/* ==================== Vector Fields ==================== */
.property-label-row {
    flex: 0 0 35%;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 140px;
}

.property-expand-btn {
    width: 16px;
    height: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.property-expand-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #999;
}

.property-vector-compact {
    flex: 1;
    display: flex;
    gap: 2px;
    min-width: 0;
}

.property-vector-axis-compact {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    position: relative;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    height: 22px;
    overflow: hidden;
}

.property-vector-axis-compact:hover {
    border-color: #4a4a4a;
    background: #1e1e1e;
}

.property-vector-axis-compact:focus-within {
    border-color: #d4a029;
}

.property-input-number-compact {
    flex: 1 1 0;
    min-width: 0;
    text-align: left;
    padding: 0 6px;
    font-size: 11px;
    height: 100%;
    line-height: 22px;
    background: transparent;
    border: none;
    color: #ddd;
    font-family: 'Consolas', 'Monaco', monospace;
}

.property-input-number-compact:focus {
    outline: none;
}

.property-vector-expanded {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
    min-width: 0;
    overflow: hidden;
}

.property-vector-axis {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.property-vector-axis .property-input {
    flex: 1;
    min-width: 0;
}

/* Color bar axis indicator */
.property-vector-axis-label {
    width: 4px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    flex-shrink: 0;
    cursor: ew-resize;
    user-select: none;
}

.property-vector-axis-x {
    background: #c04040;
}

.property-vector-axis-y {
    background: #40a040;
}

.property-vector-axis-z {
    background: #4060c0;
}

.property-vector-axis-w {
    background: #a040a0;
}

/* ==================== Array Field ==================== */
.property-array-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.property-array-count {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

.property-array-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.property-array-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.property-array-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

/* ==================== Section Header ==================== */
.property-section {
    border-bottom: 1px solid #2a2a2a;
}

.property-section-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #2a2a2a;
    cursor: pointer;
    user-select: none;
    min-height: 26px;
}

.property-section-header:hover {
    background: #333;
}

.property-section-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.property-section-expand.expanded {
    transform: rotate(90deg);
}

.property-section-title {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: #ccc;
}

.property-section-info {
    font-size: 10px;
    color: #666;
    margin-left: auto;
}

.property-section-content {
    /* Content styles */
}

.property-section-content.collapsed {
    display: none;
}

/* ==================== Property Actions ==================== */
.property-actions {
    display: flex;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.property-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    color: #999;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.15s ease;
}

.property-action-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.property-action-btn:active {
    transform: scale(0.95);
}

/* ==================== Focus State ==================== */
.property-field:focus-within {
    background: rgba(255, 255, 255, 0.03);
}

/* ==================== Animation Clips Editor ==================== */
.animation-clips-editor {
    padding: 8px;
    background: #262626;
    border-radius: 4px;
}

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

.clips-label {
    font-size: 11px;
    font-weight: 500;
    color: #999;
}

.add-clip-btn {
    padding: 4px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.add-clip-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.clips-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: #666;
    font-size: 11px;
}

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

.clip-item {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    overflow: hidden;
}

.clip-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 11px;
    color: #ddd;
    min-width: 0;
}

.clip-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.clip-header > svg {
    flex-shrink: 0;
}

.clip-name-input {
    flex: 1;
    min-width: 40px;
    background: transparent;
    border: none;
    color: #ddd;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
}

.clip-name-input:focus {
    outline: none;
    background: #333;
}

.frame-count {
    flex-shrink: 0;
    font-size: 10px;
    color: #666;
    white-space: nowrap;
}

.preview-clip-btn {
    flex-shrink: 0;
    padding: 2px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.preview-clip-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.preview-clip-btn.is-playing {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.set-default-btn {
    flex-shrink: 0;
    padding: 2px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.set-default-btn:hover {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.set-default-btn.is-default {
    color: #facc15;
    background: rgba(250, 204, 21, 0.15);
}

.remove-clip-btn {
    flex-shrink: 0;
    padding: 2px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 2px;
}

.remove-clip-btn:hover {
    background: #ef4444;
    color: #fff;
}

.clip-content {
    padding: 8px;
    border-top: 1px solid #3a3a3a;
    background: rgba(0, 0, 0, 0.1);
}

.clip-settings {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 10px;
    color: #999;
}

.clip-settings label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.clip-settings input[type="checkbox"] {
    width: 12px;
    height: 12px;
}

.clip-settings input[type="number"] {
    width: 50px;
    padding: 2px 4px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    color: #ddd;
    font-size: 10px;
}

.frames-section {
    margin-top: 8px;
}

.frames-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
}

.frames-header button {
    padding: 2px 4px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.frames-header button:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.frames-empty {
    font-size: 10px;
    color: #666;
    padding: 8px;
    text-align: center;
}

.frames-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    border: 1px dashed #444;
    border-radius: 4px;
    cursor: pointer;
}

.frames-drop-zone:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.frames-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.frame-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    font-size: 10px;
}

.frame-index {
    width: 16px;
    color: #666;
    text-align: center;
}

.frame-texture-field {
    flex: 1;
    min-width: 0;
}

.frame-duration {
    width: 45px;
    padding: 2px 4px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 2px;
    color: #ddd;
    font-size: 10px;
    text-align: right;
}

.frame-item button {
    padding: 2px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 2px;
}

.frame-item button:hover {
    background: #ef4444;
    color: #fff;
}

/* ==================== Reduced Motion ==================== */
@media (prefers-reduced-motion: reduce) {
    .property-input,
    .property-toggle,
    .property-toggle-thumb,
    .property-expand-btn,
    .property-color-preview,
    .property-section-expand {
        transition: none;
    }
}
