/*
 *  Copyright (c) 2014 by The Concord Consortium, Inc. All rights reserved.
 *
 *  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.
 */
sc_require('resources/slickgrid/slick.grid.css')
sc_require('resources/slickgrid/examples/slick-default-theme.css')
sc_require('resources/slickgrid/plugins/slick.headermenu.css')

/*
 * slick.grid.css style overrides/extensions
 */
.slick-header.ui-state-default, .slick-header-column.ui-state-default, .slick-header-columns {
  background-image: none;
}

.slick-header-columns {
  height: 30px;
  line-height: 1.2em;

}

.slick-header-column.ui-state-default {
  text-align: center;
  font-weight: 400;
  height: 30px;
  float: none;
  vertical-align: top;
  color: #555555;
  text-decoration: none;
  background: #e6e6e6;
  cursor: pointer;
}

.slick-header-column.ui-state-default:hover {
  text-decoration: underline;
  color: #1b5798;
}

.slick-column-name {
  overflow: hidden; /* avoid spill-over into next column */
  position: relative;
  display: block; /* slickgrid creates spans. To avoid unnecessary code changes,
                     we make the span behave like a div. */
  line-height: 1.2em;
}

.slick-column-name .dg-attr-name-edit-input {
  height: 1.6em;
  border: none;
  font-weight: normal;
}

.slick-column-name .two-line-header-line-1{
  display: block;
  text-align: left;
  white-space: normal;
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
  height: 2.4em;
  overflow: hidden;
}

.slick-column-name .two-line-header-line-2 {
  display:none;
  direction: rtl; /* The second line, when visible, will present the end of the
                     string. RTL does this. */
  height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: bidi-override;
}

.slick-column-name.two-line-header-truncating .two-line-header-line-1 {
  text-overflow: ellipsis;
  height: 1.2em;
}

.slick-column-name.two-line-header-truncating .two-line-header-line-2 {
  display: block;
}


.slick-cell, .slick-headerrow-column {
  z-index: auto;
}


/*
 * slick-default-theme.css style overrides/extensions
 */
.slick-row {
  line-height: 14px;
}

/*
 * Disable SlickGrid's placement of collapse/expand icon within the group row.
 */
.slick-group-toggle.expanded {
  background: none;
}

.slick-group-toggle.collapsed {
  background: none;
}

.slick-cell.selected {
    background-color: rgba(26, 122, 147, 0.3);
}
.slick-cell.editable {
  background-color: white;
}
/**
 * Style the drop-down menu here since the plugin stylesheet mostly contains structural CSS.
 * Based on http://mleibman.github.com/SlickGrid/examples/example-plugin-headermenu.html
 * slick.headermenu.css overrides/extensions
 */

.slick-header-menu {
  border: 1px solid #718BB7;
  background: #f0f0f0;
  padding: 2px;
  -moz-box-shadow: 2px 2px 2px silver;
  -webkit-box-shadow: 2px 2px 2px silver;
  min-width: 100px;
  z-index: 20;
}

.slick-header-menubutton {
  /* should match the color of the column header cells */
  background-color: #e6e6e6;
}

.slick-header-menuitem {
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.slick-header-menuitem:hover {
  border-color: silver;
  background: white;
}

.slick-header-menuitem-disabled {
  border-color: transparent !important;
  background: inherit !important;
}

.slick-viewport {
  /* enable momentum scrolling in case table body */
  -webkit-overflow-scrolling: touch;
  /*
   * The following is address webkit bug where scroller thumb did not respect z-axis.
   * See: http://stackoverflow.com/questions/16874546/strange-z-index-behavior-with-scrollbars-under-chrome
   */
  -webkit-transform: translate3d(0, 0, 0);
}


/*
   Override the slick grid setting so that the drag handle can overlap the column
   boundary
 */
.slick-header-columns .slick-header-column {
  overflow: initial;
}

/*
   Drag handles are positioned slightly to the right of the column header edge
   raised above the fray so they can be grabbed.
 */
.slick-header-columns .slick-header-column .slick-resizable-handle {
  right: -4px;
  z-index: 10;
}

/* sets the last columns handle to the left of the component border */
.slick-header-columns .slick-header-column:last-of-type .slick-resizable-handle {
  right: 5px;
}
