@import "button";


/**********
 ! Notebook
***********/

@include exports("notebook") {
    notebook {
        background-color: $base_color;

        > header {
            padding: 0;
            margin: 0;
            border-width: 0;
            border-radius: 0;
            background-image: none;
            background-clip: border-box;
            background-color: shade($base_color, .9);
            color: $text_color;

            &.frame {
                border-color: border_normal($base_color);

                &.top { border-width: 1px 1px 0; }

                &.right { border-width: 1px 1px 1px 0; }

                &.bottom { border-width: 0 1px 1px; }

                &.left { border-width: 1px 0 1px 1px; }
            }

            tabs arrow {
                margin: 5px;
            }
        }

        viewport {
            border-width: 0;
            background-color: $base_color;
            color: $text_color;
        }

        tab {
            padding: ($spacing + 1) ($spacing * 2);
            border: 1px solid transparent;
            background-color: transparent;
            background-image: none;

            &:hover {
                background-color: shade($base_color, .95);
                border-color: shade($base_color, .8);
            }

            &:checked {
                background-color: $base_color;
                background-image: none;
                border-color: shade($base_color, .85);

                label { color: $text_color; }
            }

            &.top {
                border-bottom-width: 0;
                border-bottom-right-radius: 0;
                border-bottom-left-radius: 0;
            }

            &.right {
                border-left-width: 0;
                border-bottom-left-radius: 0;
                border-top-left-radius: 0;
            }


            &.bottom {
                border-top-width: 0;
                border-top-right-radius: 0;
                border-top-left-radius: 0;
            }

            &.left {
                border-right-width: 0;
                border-top-right-radius: 0;
                border-bottom-right-radius: 0;
            }

            button.flat {
                &:hover { color: shade(currentColor, .95); }

                &, &:backdrop { color: gtkalpha(currentColor, .3); }

                padding: 0;
                margin-top: 4px;
                margin-bottom: 4px;
                // FIXME: generalize .small-button?
                min-width: 20px;
                min-height: 20px;

                &:last-child {
                    margin-left: 4px;
                    margin-right: -4px;
                }

                &:first-child {
                    margin-left: -4px;
                    margin-right: 4px;
                }
            }

            label { color: mix($text_color, $base_color, .3); }
        }

        .prelight-page {
            &, label { color: mix($text_color, $base_color, .15); }
        }

        .active-page {
            &, label { color: $text_color; }
        }

        .reorderable-page {
            &:hover {
                background-color: shade($base_color, .85);
                //border-left: 0; // TODO: I turned it off because it made the tabs to collide, eg gedit. It needs fixing.
                //border-right: 0;
                /* using box shadows instead of borders due to slanted edges */
                box-shadow: inset 0 3px alpha($black, .03), inset 0 2px alpha($black, .03), inset 0 1px alpha($black, .03),
                            inset 1px 0 shade($base_color, .7), inset -1px 0 shade($base_color, .7);
            }

            &:checked {
                background-color: shade($base_color, .9);
                //border-left: 0;
                //border-right: 0;
                box-shadow: inset 0 3px alpha($black, .03), inset 0 2px alpha($black, .03), inset 0 1px alpha($black, .03),
                            inset 1px 0 shade($base_color, .75), inset -1px 0 shade($base_color, .75);
            }
        }
    }
}