/* CMS Component Palette Styles */

/* Palette Container */
.cms-component-palette {
    width: 280px;
    height: 100%;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease-out;
}

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

/* Search Box */
.cms-palette-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

/* Component List */
.cms-palette-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Individual Component Item */
.cms-palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: #ffffff;
}

.cms-palette-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #f0b323; /* EAA Gold */
    background-color: #fffef9;
}

.cms-palette-item:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

.cms-palette-item:active {
    transform: translateY(0) scale(0.98);
}

/* Item Content */
.cms-palette-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.cms-palette-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cms-palette-item-text {
    flex: 1;
}

.cms-palette-item-drag {
    display: flex;
    align-items: center;
    opacity: 0.3;
    transition: opacity 0.15s ease;
}

.cms-palette-item:hover .cms-palette-item-drag {
    opacity: 0.7;
}

/* Footer */
.cms-palette-footer {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    text-align: center;
}

/* Responsive Behavior */
@media (max-width: 1279px) {
    .cms-component-palette {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1200;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
    }

    .cms-component-palette.open {
        transform: translateX(0);
    }
}

@media (min-width: 1280px) {
    .cms-component-palette {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1100;
    }
}

/* Animation for filtered items */
.cms-palette-item {
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.cms-palette-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.cms-palette-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cms-component-palette,
    .cms-palette-item {
        transition: none;
        animation: none;
    }

    .cms-palette-item:hover {
        transform: none;
    }
}

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

    .cms-palette-item:focus {
        outline-width: 3px;
    }
}
