/*****************************************************************************
 * Open MCT Web, Copyright (c) 2014-2015, United States Government
 * as represented by the Administrator of the National Aeronautics and Space
 * Administration. All rights reserved.
 *
 * Open MCT Web is licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * Open MCT Web includes source code licensed under additional open source
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 * this source code distribution or the Licensing information page available
 * at runtime from the About dialog for additional information.
 *****************************************************************************/

.splitter {
    // Redo the splitter.
    // New look is a simple line.
    // Main width is used to provide a good click area, and is always transparent
    // :after will be a positioned and colored element that is the handle

    //@include test(red);
    display: block;
    position: absolute;
    z-index: 3;
    &:after {
        // The handle
        content:"";
        pointer-events: none;
        @include absPosDefault(0);
        background: $colorSplitterBg;
        display: block;

        @if $splitterEndCr != 'none' {
            @include border-radius($splitterEndCr);
        }
    }
    &:active {
        &:after {
            background-color: $colorSplitterActive !important;
        }
    }

    @if $colorSplitterHover != 'none' {
        &:not(:active) {
            &:hover {
                &:after {
                    background-color: $colorSplitterHover !important;
                    @include trans-prop-nice(background-color, 150ms);
                }
            }
        }
    }
}

.split-layout {
    $inset: splitterHandleInset($splitterD,$splitterHandleD);
    &.horizontal {
        // Slides vertically up and down, splitting the element horizontally
        overflow: hidden; // Suppress overall scroll; each internal pane handles its own overflow
        .pane {
            left: 0;
            right: 0;
            &.top {
                bottom: auto;
            }
            &.bottom {
                top: auto;
            }
        }
        >.splitter {
            cursor: row-resize;
            left: 0;
            right: 0;
            height: $splitterD;
            &:after {
                top: $inset; bottom: $inset;
            }
        }
    }

    &.vertical {
        // Slides horizontally left to right, splitting the element vertically
        .pane {
            top: 0;
            bottom: 0;
            &.left {
                right: auto;
            }
            &.right {
                left: auto;
            }
        }
        >.splitter {
            cursor: col-resize;
            top: 0;
            bottom: 0;
            &:not(.flush-right) {
                width: $splitterD;
                &:after {
                    left: $inset; right: $inset;
                }
            }
            &.flush-right {
                width: ceil($splitterD / 2);
                &:after {
                    background-color: transparent;
                    left: auto; right: 0; width: $splitterHandleD;
                }
                &.edge-shdw {
                    @include background-image(linear-gradient(90deg, rgba(black, 0) 40%, rgba(black, 0.05) 70%, rgba(black, 0.2) 100%));
                }
            }
        }
    }
}
