/* ==================== CONTAINERS (COMPONENTS V2) ==================== */

.containers-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Add Component Button & Dropdown */
.add-component-wrapper {
    position: relative;
}

.add-component-btn {
    width: 100%;
    background: #ff6788;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #000;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.add-component-btn:hover {
    background: #ff7a98;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 103, 136, 0.3);
}

.add-component-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #2b2d31;
    border: 1px solid #1e1f22;
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.add-component-menu.show {
    display: block;
}

.component-type-option {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #dbdee1;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.component-type-option:hover {
    background: #3a3a3f;
    border-left-color: #ff6788;
}

.component-type-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b5bac1;
    font-size: 1rem;
}

.component-type-option:hover .component-type-icon {
    color: #ff6788;
}

/* Container Items */
.container-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.container-item {
    background: #1a1a1e;
    border: 2px solid #3a3a3f;
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.container-item:hover {
    border-color: #4a4a4f;
}

.container-item.dragging {
    opacity: 0.5;
    border-color: #ff6788;
}

.container-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #3a3a3f;
}

.drag-handle {
    cursor: grab;
    color: #949ba4;
    font-size: 1.125rem;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #ff6788;
}

.drag-handle:active {
    cursor: grabbing;
}

.container-item-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.container-item-title i {
    color: #ff6788;
}

.container-item-remove {
    background: transparent;
    border: none;
    color: #949ba4;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.container-item-remove:hover {
    background: rgba(237, 66, 69, 0.1);
    color: #ed4245;
}

/* Container Item Body */
.container-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Text Content Component */
.text-content-editor {
    width: 100%;
}

.text-content-editor textarea {
    width: 100%;
    min-height: 100px;
    background: #242429;
    border: 1px solid #242429;
    border-radius: 4px;
    padding: 0.75rem;
    color: #fff;
    font-size: 0.875rem;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.text-content-editor textarea:focus {
    outline: none;
    border-color: #ff6788;
    box-shadow: 0 0 0 1px #ff6788;
}

/* Main Container Component */
.main-container-wrapper {
    border: 2px solid #ff6788;
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 103, 136, 0.05);
}

.container-accent-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.container-accent-color label {
    color: #b5bac1;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.container-accent-color input[type="color"] {
    width: 60px;
    height: 38px;
    background: #242429;
    border: 1px solid #242429;
    border-radius: 4px;
    cursor: pointer;
}

.nested-components {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #3a3a3f;
}

.nested-components-label {
    color: #949ba4;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    display: block;
}

/* Container with Accessory */
.container-with-accessory {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
}

.accessory-selector {
    min-width: 200px;
}

.accessory-selector label {
    color: #b5bac1;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

/* Media Gallery Component */
.media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    background: #242429;
    border: 2px dashed #3a3a3f;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.media-item:hover {
    border-color: #ff6788;
    background: rgba(255, 103, 136, 0.05);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-placeholder {
    color: #949ba4;
    font-size: 2rem;
}

.media-item-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-item:hover .media-item-remove {
    opacity: 1;
}

/* File Component */
.file-upload-area {
    background: #242429;
    border: 2px dashed #3a3a3f;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-area:hover {
    border-color: #ff6788;
    background: rgba(255, 103, 136, 0.05);
}

.file-upload-icon {
    font-size: 2rem;
    color: #949ba4;
    margin-bottom: 0.5rem;
}

.file-upload-text {
    color: #dbdee1;
    font-size: 0.875rem;
    font-weight: 500;
}

.file-upload-subtext {
    color: #949ba4;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Separator Component */
.separator-config {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.separator-preview {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3a3a3f, transparent);
}

.separator-spacing-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.separator-spacing-control label {
    color: #b5bac1;
    font-size: 0.75rem;
    font-weight: 600;
}

.separator-spacing-control input {
    width: 80px;
}

/* Empty State */
.containers-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #949ba4;
}

.containers-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.containers-empty-state p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.containers-empty-state small {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Modal Overlay - Only for container component modals */
.modal-overlay.nested-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.nested-component-modal {
    background: #2b2d31;
    border: 1px solid #1e1f22;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.modal-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.nested-component-modal .component-type-option {
    background: #1a1a1e;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 1rem;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
}

.nested-component-modal .component-type-option:hover {
    background: #242429;
    border-color: #ff6788;
    transform: translateX(4px);
}

.modal-cancel {
    width: 100%;
    margin-top: 0.5rem;
}

/* Nested Component Drag Handle */
.nested-drag-handle {
    opacity: 0.6;
    transition: all 0.2s ease;
}

.nested-drag-handle:hover {
    opacity: 1;
    color: #ff6788 !important;
}

.nested-drag-handle:active {
    cursor: grabbing !important;
}

.nested-component-item.dragging {
    opacity: 0.5;
    border-color: #ff6788 !important;
}

/* Mode Toggle (Button/Thumbnail selector) */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
    background: #1a1a1e;
    padding: 0.25rem;
    border-radius: 6px;
}

.mode-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #dbdee1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-btn:hover {
    background: #242429;
    color: #fff;
}

.mode-btn.active {
    background: #ff6788;
    color: #000;
}

.mode-btn i {
    font-size: 0.875rem;
}
