////////////////////////////////////////////////////////////////////////////////
//
//  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 SimpleTable

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

    .jewel.thead tr
        border-bottom: 1px solid $default-color
    
    // th
    .jewel.tableheadercell:first-of-type
        border-left: 0px
    .jewel.tableheadercell
        @if $flat
            background: $default-color
        @else
            background: linear-gradient(lighten($default-color, 15%), lighten($default-color, 10%))
            box-shadow: inset 0 1px 0 lighten($default-color, 20%)
        font-weight: 700
        line-height: normal !important
        font-size: $font-size
        color: $default-font-color
        border-left: 1px solid $default-color
    
    // td
    .jewel.tablecell:first-of-type
        border-left: 0px
    .jewel.tablecell
        border-top: 1px solid $default-color
        border-left: 1px solid $default-color

    .jewel.tfoot
        .jewel.tablecell
            border-left: 0px
            @if $flat
                background: lighten($default-color, 10%)
            @else
                background: linear-gradient(lighten($default-color, 15%), lighten($default-color, 20%))
                box-shadow: inset 0 1px 0 lighten($default-color, 30%)
        // border-bottom: 1px solid darken($light-color, 20%)


// Jewel Table

// Table variables
$table-border-radius: $border-radius

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

    .jewel.thead tr
        border-bottom: 1px solid $default-color

    // th
    .jewel.tableheadercell:first-of-type
        border-left: 0px
    .jewel.tableheadercell
        @if $flat
            background: $default-color
        @else
            background: linear-gradient(lighten($default-color, 15%), lighten($default-color, 10%))
            box-shadow: inset 0 1px 0 lighten($default-color, 20%)
        font-weight: 700
        line-height: normal !important
        font-size: $font-size
        color: $default-font-color
        border-left: 1px solid $default-color
    
    // td
    .jewel.tablecell:first-of-type
        border-left: 0px
    .jewel.tablecell
        border-top: 1px solid $default-color
        border-left: 1px solid $default-color

    .jewel.tfoot
        .jewel.tablecell
            border-left: 0px
            @if $flat
                background: lighten($default-color, 10%)
            @else
                background: linear-gradient(lighten($default-color, 15%), lighten($default-color, 20%))
                box-shadow: inset 0 1px 0 lighten($default-color, 30%)

// .jewel.tableheadercell
//     border: 1px solid black

.jewel.tableitem

    &.hovered:hover
        color: $font-theme-color
        background: $primary-color

    &.selected, &.selectable:active
        color: $font-theme-color
        background: darken($primary-color, 5%)
