/* CMS Properties Panel Styles */

/* Panel Container */
.cms-properties-panel {
    width: 320px;
    height: 100%;
    background-color: #ffffff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease-out;
}

/* Header */
.cms-properties-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
}

/* Content Area */
.cms-properties-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Empty State */
.cms-properties-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 32px;
}

/* Fixed Right Sidebar (Desktop) */
@media (min-width: 1280px) {
    .cms-properties-panel {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 1100;
        transform: translateX(100%);
    }

    .cms-properties-panel.open {
        transform: translateX(0);
    }
}

/* Overlay Panel (Tablet/Small Desktop) */
@media (max-width: 1279px) {
    .cms-properties-panel.overlay {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 1200;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
    }

    .cms-properties-panel.overlay.open {
        transform: translateX(0);
    }
}

/* Scrollbar Styling */
.cms-properties-content::-webkit-scrollbar {
    width: 6px;
}

.cms-properties-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cms-properties-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.cms-properties-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Panel Slide Animation */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cms-properties-panel.open {
    animation: slideInFromRight 0.25s ease-out;
}

/* Property Groups */
.cms-property-group {
    margin-bottom: 24px;
}

.cms-property-group-title {
    font-weight: 600;
    color: #0d5d2c;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* Required Field Indicator */
.cms-required-field::after {
    content: " *";
    color: #d32f2f;
}

/* Validation Error */
.cms-validation-error {
    color: #d32f2f;
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cms-validation-error svg {
    width: 16px;
    height: 16px;
}

/* Property Input Spacing */
.cms-properties-content .mud-input-control {
    margin-bottom: 16px;
}

.cms-properties-content .mud-checkbox {
    margin-bottom: 12px;
}

.cms-properties-content .mud-slider {
    margin-bottom: 24px;
}

/* Color Picker Container */
.cms-color-picker-container {
    margin-bottom: 16px;
}

/* Icon Picker Grid */
.cms-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.cms-icon-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cms-icon-picker-item:hover {
    background-color: #f0b323;
    border-color: #f0b323;
    color: white;
}

.cms-icon-picker-item.selected {
    background-color: #0d5d2c;
    border-color: #0d5d2c;
    color: white;
}

/* Help Text */
.cms-help-text {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
}

/* Responsive Adjustments */
@media (max-width: 959px) {
    .cms-properties-panel {
        width: 100vw;
        max-width: 400px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cms-properties-panel {
        transition: none;
        animation: none;
    }
}

/* Accessibility - High Contrast */
@media (prefers-contrast: high) {
    .cms-properties-panel {
        border-left-width: 2px;
    }

    .cms-property-group-title {
        border-bottom-width: 2px;
    }
}

/* Loading State */
.cms-properties-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

/* Backdrop for Overlay Mode */
.cms-properties-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1199;
    transition: opacity 0.25s ease;
}

.cms-properties-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}
