////////////////////////////////////////////////////////////////////////////////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You 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.
//
////////////////////////////////////////////////////////////////////////////////

// Jewel DataGrid

// DataGrid variables
.jewel.datagrid
    @if $flat
        background: lighten($default-color, 15%)
        border-bottom: 1px solid $default-color
        box-shadow: none
    @else
        background: linear-gradient(lighten($default-color, 15%), lighten($default-color, 10%))
        border-bottom: 1px solid darken($default-color, 15%)
        box-shadow: inset 0 1px 0 lighten($default-color, 20%)
        border-radius: $border-radius


    .jewel.buttonbar.header
        @if $flat
            background: $default-color
            border: 0 none
            box-shadow: none
        @else
            background: linear-gradient(lighten($default-color, 10%), lighten($default-color, 5%))
            border: 0 none
            box-shadow: none
            border-top-left-radius: $border-radius
            border-top-right-radius: $border-radius

        .jewel.button
            &.first
                border-bottom-left-radius: 0

            &.last
                border-bottom-right-radius: 0
    
    .listarea
        border-top-width: 0px
        border-left-width: 0px
        border-right-width: 0px
        border-bottom-width: 0px
        border-bottom-left-radius: $border-radius
        border-bottom-right-radius: $border-radius
        border-style: solid
        @if $flat
            border-color: $default-color
        @else
            border-color: darken($default-color, 15%)

        &:focus
            @if $flat
                border: 1px solid $primary-color
            @else
                border: 1px solid darken($primary-color, 15%)

    .jewel.list
        
        &:focus
            @if $flat
                border-color: inherit
            @else
                border-color: inherit
        &.column
            border-radius: 0px
            border-bottom-width: 0px
            @if not $flat
                box-shadow: inset 0px 1px 0px 0px rgba(0, 0, 0, 0.1)
            @else
                box-shadow: none


            &.first
                border-bottom-left-radius: $border-radius
            &.middle

            &.last
                border-bottom-right-radius: $border-radius
            
            .jewel.item.datagrid
                border-top: none
                border-left: none
                border-right: none
                border-bottom: 1px solid lighten($default-color, 8%)
                border-right: 0
                border-radius: 0
                box-shadow: none
                
                &.primary
                    &.hovered
                        background: lighten($primary-color, 12%)
                    &.selected, &.selectable:active
                        background: lighten($primary-color, 7%)