// Styling for the vellum container and its main content blocks: question tree, question properties panel, etc.
@import "lib/main";

body.vellum-full-screen {
    overflow-y: hidden;
}

// Wrapper around all of vellum, gets no styling
.formdesigner {

    // Another wrapper around all of vellum, can be styled (say, for full-screen mode)
    .fd-ui-container {
        top: 0;
        width: 100%;
        background-color: white;

        &.full-screen {
            z-index: @zindexUIContainer;
        }

        // Major content block (column or divider)
        .fd-content {
            float: left;

            // Left column: question tree & data tree
            &.fd-content-left {
                width: 30%;

                .fd-head h2 {
                }

                .fd-add-question {
                    max-width: 140px;
                    width: 90%;
                    margin: 10px;
                    overflow: hidden; // to hide any content that exceeds the button's width
                    text-overflow: ellipsis; // to show an ellipsis (...) when the text is too long
                }

                // Bottom half of left column: data tree
                .fd-accessory-pane {
                    overflow-x: hidden;
                    overflow-y: auto;
                }
            }

            // Right column: question properties or expression editor
            &.fd-content-right {
                .fd-head {
                    height: 31px;

                    h2 {
                        line-height: 30px;
                    }
                }

                // Tweak bootstrap's well styles
                .well {
                    padding: 10px;

                    // Vellum's wells use col-sm-1 columns to squeeze in small items that usually have enough padding
                    .col-sm-1 {
                        padding: 0;
                    }
                }

                // Bar with save button
                .fd-form-actions {
                    background-color: @cc-brand-mid !important; // lazy
                    padding: 5px 8px 8px;
                }
            }

            // Intro content for any panel ("New Form, please add questions above...")
            .fd-default-panel {
                padding-left: @contentPaddingVellum;
            }

            // Heading for any panel (question tree, expression editor, etc.)
            .fd-head {
                @menuContainerWidth: 50px;
                color: @white;
                background-color: @cc-brand-low;
                font-size: 17px;    // size icons
                height: @treeBrowserHeadHeight;
                position: relative;

                // Icon to expand/collapse panel
                .fd-head-max-indicator {
                    position: absolute;
                    right: 10px;

                    i {
                        color: @cc-neutral-hi;
                    }
                }

                // Light up expand/collapse icon when mouseover header
                &:hover .fd-head-max-indicator i {
                    color: @white;
                }

                > h2 {
                    font-size: @baseFontSize * 0.9;
                    padding: 1px @contentPaddingVellum 0;
                    margin: 0;
                    font-weight: normal;
                    line-height: 23px;
                    .text-overflow();
                    position: absolute;
                    left: 0;
                    right: @menuContainerWidth - @contentPaddingVellum;
                }

                // Question tree menu (language switcher, copy, paste, etc.)
                .fd-head-menu-container {
                    position: absolute;
                    right: 0px;
                    top: 0px;
                    line-height: 23px;
                    font-size: @baseFontSize * 0.9;
                    min-width: @menuContainerWidth;

                    // Icon link to open dropdown
                    .dropdown {
                        .dropdown-toggle {
                            color: @white;
                            cursor: pointer;
                            display: block;
                            padding: 0 @contentPaddingVellum;
                            text-decoration: none;
                            background-color: @cc-brand-low;

                            &:hover {
                                text-decoration: none;
                                background-color: @cc-brand-mid;
                            }
                        }

                        // Menu options
                        .dropdown-menu {
                            a {
                                min-width: 170px;

                                > .hotkey {
                                    float: right;
                                }
                            }
                        }
                    }
                }
            }
        }

        // Draggable separators between .fd-content blocks
        .fd-content-vertical-divider {
            width: 5px;
            background: @cc-brand-mid;
        }

        .fd-content-horizontal-divider {
            height: 10px;
            margin: 1px 0;
            background: @navbarBackground;
            text-align: center;
            font-size: 16px;
            color: @navbarText;
            position: relative;

            i {
                display: inline-block;
                position: absolute;
            }
        }

        // Vellum-level messages displayed across bottom of screen
        .fd-messages {
            position: fixed;
            bottom: 40px;
            left: 0;
            width: 100%;

            .alert {
                .box-shadow(0px 0px 10px rgba(0, 0, 0, 0.4));
                margin: @gridGutterWidth;
                height: auto;
                overflow: auto;
                max-height: 200px;
            }
        }

        // Let major content blocks scroll independently (i.e., tree versus expression editor)
        // .fd-scrollable is for containers meant to take the full screen height (e.g., question properties panel)
        // .fd-scrollable-minimal is for containers that should not grow taller than their content (e.g., menus)
        .fd-scrollable, .fd-scrollable-minimal {
            overflow-x: hidden;
            overflow-y: auto;

            // Prevent scrollbars underneath the modal from bleeding through on OSX
            transform: translate3d(0, 0, 0);
        }

        .fd-scrollable {
            height: @containerHeight;
            width: 100%;    // If applied to .fd-scrollable-minimal too, this makes their content also scroll horizontally
        }

        .fd-scrollable-minimal {
            max-height: @containerHeight;
        }
    }
}
