:host {
    display: block;
    width: 100%;
    font-size: 13px;
}

.duzlem-kontrol-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
    max-width: 300px;

    // Button row
    .button-row {
        display: flex;
        gap: 6px;
        padding: 8px 0;
        border-bottom: 1px solid #e5e7eb;
        flex-wrap: wrap;

        button {
            position: relative;
            width: 36px;
            height: 36px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;

            // Icon styles
            .icon {
                width: 18px;
                height: 18px;
                display: inline-block;

                &::before {
                    display: block;
                    font-size: 16px;
                    line-height: 1;
                }
            }

            // Icon classes
            .move::before { content: '↔️'; }
            .exchange::before { content: '🔄'; }
            .target::before { content: '🎯'; }
            .surface-center::before { content: '📍'; }
            .scene-center::before { content: '⊕'; }
            .refresh::before { content: '🔄'; }
            .plus::before { content: '+'; }
            .trash::before { content: '🗑️'; }

            &.btn-primary {
                background: #3b82f6;
                color: white;

                &:hover {
                    background: #2563eb;
                    transform: translateY(-1px);
                }

                &:active {
                    transform: translateY(0);
                }
            }

            &.btn-secondary {
                background: #f3f4f6;
                color: #374151;
                border: 1px solid #e5e7eb;

                &:hover {
                    background: #e5e7eb;
                    transform: translateY(-1px);
                }
            }

            &.btn-select {
                background: #f3f4f6;
                color: #374151;
                border: 1px solid #e5e7eb;

                &.active {
                    background: #3b82f6;
                    color: white;
                    border-color: #3b82f6;
                }

                &:hover {
                    background: #e5e7eb;
                    transform: translateY(-1px);

                    &.active {
                        background: #2563eb;
                    }
                }
            }

            &.btn-reset {
                background: #fef2f2;
                color: #dc2626;
                border: 1px solid #fecaca;

                &:hover {
                    background: #fee2e2;
                    transform: translateY(-1px);
                }
            }

            &.btn-icon {
                width: 28px;
                height: 28px;
                background: transparent;
                color: #6b7280;
                border-radius: 4px;

                &:hover {
                    background: #fee2e2;
                    color: #dc2626;
                }
            }

            &:disabled {
                opacity: 0.5;
                cursor: not-allowed;
                transform: none !important;
            }
        }
    }

    // Plane section
    .plane-section {
        display: flex;
        flex-direction: column;
        gap: 8px;

        .plane-list {
            display: flex;
            flex-direction: column;
            gap: 4px;

            .plane-item {
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 10px 12px;
                background: #f9fafb;
                border: 1px solid #e5e7eb;
                border-radius: 6px;
                cursor: pointer;
                transition: all 0.2s ease;

                &:hover {
                    background: #f3f4f6;
                    border-color: #d1d5db;
                }

                &.active {
                    background: #eff6ff;
                    border-color: #3b82f6;

                    .plane-name {
                        color: #1d4ed8;
                        font-weight: 500;
                    }
                }

                .plane-name {
                    font-size: 14px;
                    color: #374151;
                    font-weight: 400;
                }

                .btn-icon {
                    margin-left: 8px;
                }
            }
        }

        .btn-add {
            width: 100%;
            height: 36px;
            border: 2px dashed #d1d5db;
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #6b7280;
            font-size: 18px;
            font-weight: 600;

            &:hover:not(:disabled) {
                border-color: #3b82f6;
                color: #3b82f6;
                background: #eff6ff;
            }

            &:disabled {
                cursor: not-allowed;
                opacity: 0.5;
            }
        }
    }
}

// Dark mode support (optional)
@media (prefers-color-scheme: dark) {
    .duzlem-kontrol-container {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

        .button-row {
            border-bottom-color: #374151;

            button {
                &.btn-secondary {
                    background: #374151;
                    color: #f3f4f6;
                    border-color: #4b5563;

                    &:hover {
                        background: #4b5563;
                    }
                }

                &.btn-select {
                    background: #374151;
                    color: #f3f4f6;
                    border-color: #4b5563;

                    &.active {
                        background: #3b82f6;
                        color: white;
                    }
                }
            }
        }

        .plane-section {
            .plane-list {
                .plane-item {
                    background: #374151;
                    border-color: #4b5563;
                    color: #f3f4f6;

                    &:hover {
                        background: #4b5563;
                    }

                    &.active {
                        background: #1e3a8a;
                        border-color: #3b82f6;

                        .plane-name {
                            color: #93c5fd;
                        }
                    }

                    .plane-name {
                        color: #f3f4f6;
                    }
                }
            }

            .btn-add {
                border-color: #4b5563;
                color: #9ca3af;

                &:hover:not(:disabled) {
                    border-color: #3b82f6;
                    color: #60a5fa;
                    background: #1e3a8a;
                }
            }
        }
    }
}

// Responsive design
@media (max-width: 480px) {
    .duzlem-kontrol-container {
        padding: 10px;
        max-width: 100%;

        .button-row {
            button {
                width: 24px;
                height: 24px;
                font-size: 12px;

                .icon {
                    width: 12px;
                    height: 12px;
                }
            }
        }

        .plane-section {
            .plane-list {
                .plane-item {
                    padding: 8px 10px;

                    .plane-name {
                        font-size: 13px;
                    }
                }
            }
        }
    }
}