/* CSS Flexbox Generator Styles */

/* Preview Container */
.flexbox-preview-container {
    display: flex;
    min-height: 300px;
    padding: 20px;
    background: repeating-conic-gradient(#e5e5e5 0% 25%, #f5f5f5 0% 50%) 50% / 20px 20px;
    border: 2px dashed var(--bs-border-color);
    border-radius: 12px;
    gap: 10px;
}

/* Flex Items */
.flex-item {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 60px;
    min-height: 60px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.flex-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.flex-item.selected {
    outline: 3px solid #052c65;
    outline-offset: 3px;
    transform: scale(1.05);
}

.flex-item:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.flex-item:nth-child(2):hover {
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.flex-item:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.flex-item:nth-child(3):hover {
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.flex-item:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.flex-item:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.flex-item:nth-child(6) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.3);
}

.flex-item:nth-child(n+7) {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.3);
}

/* Item Properties Panel */
#itemPropertiesPanel {
    padding: 15px;
    background: var(--bs-secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

/* CSS Code Output */
.css-output {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: var(--bs-primary-text-emphasis);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

/* Preset Layouts Grid */
.preset-layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.preset-layout-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bs-secondary-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-layout-item:hover {
    border-color: #052c65;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-mini-preview {
    width: 80px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 5px;
    overflow: hidden;
}

.preset-mini-item {
    min-width: 10px;
    min-height: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.preset-mini-item:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.preset-mini-item:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.preset-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--bs-secondary-color);
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .flexbox-preview-container {
        min-height: 250px;
        padding: 15px;
    }

    .flex-item {
        min-width: 50px;
        min-height: 50px;
        padding: 10px;
        font-size: 14px;
    }

    .preset-layouts-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .preset-layout-item {
        padding: 10px;
    }

    .preset-mini-preview {
        width: 60px;
        height: 45px;
    }

    .css-output {
        font-size: 11px;
        padding: 12px;
    }
}

/* Dark Mode */
[data-bs-theme="dark"] .flexbox-preview-container {
    background: repeating-conic-gradient(#2d2d2d 0% 25%, #3d3d3d 0% 50%) 50% / 20px 20px;
    border-color: #495057;
}

[data-bs-theme="dark"] .flex-item.selected {
    outline-color: #6ea8fe;
}

[data-bs-theme="dark"] #itemPropertiesPanel {
    background: rgba(255, 255, 255, 0.05);
    border-color: #495057;
}

[data-bs-theme="dark"] .css-output {
    background: rgba(255, 255, 255, 0.05);
    border-color: #495057;
}

[data-bs-theme="dark"] .preset-layout-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: #495057;
}

[data-bs-theme="dark"] .preset-layout-item:hover {
    border-color: #6ea8fe;
}

[data-bs-theme="dark"] .preset-mini-preview {
    background: #2d2d2d;
}
