/**
 * Copyright (c) Enalean, 2016-Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

@use "basepath";

/* stylelint-disable selector-no-qualifying-type, selector-class-pattern */

/* The wrapper div */
div.datePicker {
    position: absolute;
    z-index: 9999;
    width: 18em;
    min-width: 18em;

    /* For Example: If using the YUI font CSS, uncomment the following line to get a 10px font-size within the datePicker */

    /* font:900 77%/77% Verdana; */

    background: transparent;

    /* Change the font-size to suit your design's CSS. The following line is for the demo that has a 12px font-size defined on the body tag */
    font:
        0.8em/0.8em Verdana,
        sans-serif;
    text-align: center;
    user-select: none;
}

/* Styles for the static datePickers */
div.staticDP {
    position: relative;
    top: 5px;
    left: 0;
}

/* The iframe hack to cover selectlists in Internet Explorer <= v6 */
iframe.iehack {
    display: none;
    position: absolute;
    z-index: 9998;
    margin: 0;
    padding: 0;
    border: 0;
    background: #ffffff;
}

/* The "button" created beside each input for non-static datePickers */
a.date-picker-control:link,
a.date-picker-control:visited,
a.date-picker-control:hover,
a.date-picker-control:active,
a.date-picker-control:focus {
    /* Moz & FF */
    display: -moz-inline-stack;
    visibility: visible;
    position: relative;
    min-width: 16px;
    margin: 0 0 0 4px;
    padding: 0;
    border: 0 none;
    background: transparent url("#{basepath.$tuleap-common-theme-basepath}images/ic/cal.png")
        no-repeat 50% 50%;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
}

/* Feed IE6 the following rule, IE7 should handle the min-width declared above */
* html a.date-picker-control {
    width: 16px;
}

a.date-picker-control {
    /* IE, Safari & Opera. Seperate CSS rule seems to be required. */
    display: inline-block;
}

a.date-picker-control span {
    display: block;
    width: 16px;
    height: 16px;
    margin: auto 0;
}

/* The next & previous buttons */
div.datePicker th span {
    display: inline;
    margin: 0;
    padding: 0;
    border-width: 0;
    background: transparent;
    color: #000000;
    font-family: georgia, "times new roman", palatino, times, bookman, serif;
    font-weight: bold;
    line-height: 1.2em;
    text-align: center;
    cursor: pointer;
}

div.datePicker th span.month-display,
div.datePicker th span.year-display {
    font:
        normal 1em Verdana,
        sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: default;
}

div.datePicker th span.prev-but,
div.datePicker th span.next-but {
    font-size: 1.6em;
    cursor: pointer !important;
}

div.datePicker th span.today-but {
    width: 100%;
    margin: 0 auto;
    font:
        normal 0.8em Verdana,
        sans-serif;
    line-height: 1em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer !important;
}

div.datePicker thead th span.fd-disabled {
    color: #aaaaaa;
    cursor: default !important;
}

/* The mon, tue, wed etc day buttons */
div.datePicker th span.fd-day-header {
    width: 2em;
    height: 1.2em;
    margin: 0 auto;
    font:
        900 1em Verdana,
        sans-serif;
    line-height: 1em;
    text-align: center;
    text-decoration: none;
    text-transform: lowercase;
}

/* The table */
div.datePicker table {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    table-layout: fixed;
    border-spacing: 2px;
    border-collapse: separate;
    border: 1px solid #cccccc;
    background: #ffffff;
    text-align: center;
}

/* Common TD & TH styling */
div.datePicker table td {
    width: 2em;
    height: 2em !important;
    padding: 0;
    border: 1px solid #cccccc;
    outline: none;
    background: #ffffff;

    /* Opera requires a line-height bigger than 1em in order to redraw properly */
    line-height: 1.2em;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

div.datePicker table th {
    padding: 0;
    border: 0 none;
    color: #222222;
    font-weight: bold;
    line-height: 1.2em;
    text-align: center;
    vertical-align: middle;
}

div.datePicker table td.date-picker-unused {
    padding: 0;
    border-color: #dcdcdc;
    background: #ffffff url("#{basepath.$tuleap-common-theme-basepath}images/backstripes.gif");
    cursor: default !important;
}

div.datePicker table thead th.date-picker-title {
    width: auto;
    height: auto;
    padding: 0.4em 0;
}

/* The "mon tue wed etc" day header button styles */
div.datePicker table th.date-picker-day-header {
    width: 2em;
    text-transform: lowercase;
}

div.datePicker table th.date-picker-day-header span {
    display: block;
}

/* The "todays date" style */
div.datePicker table td.date-picker-today {
    background: #ffffa3;
    color: rgb(100 100 100) !important;
}

/* The "selected date" style */
div.datePicker table td.date-picker-selected-date {
    border-color: #333333 !important;
    color: #333333 !important;
}

/* the "highlight days" style */
td.date-picker-highlight {
    color: #a86666;
}

/* The date "out of range" style */
div.datePicker table td.out-of-range {
    background: #fcfcfc !important;
    color: #cccccc !important;
    font-style: oblique;
    cursor: default !important;
}

/* The "disabled days" style */
div.datePicker table td.day-disabled {
    background: transparent !important;
    color: #aaaaaa !important;
    cursor: default !important;
}

/* The "active cursor" style */
div.datePicker table tbody td.date-picker-hover {
    border-color: rgb(100 130 170);
    background: #ffffff;
    color: rgb(100 130 170);
    cursor: pointer;
}

/*
   Quirksmode necessity?
   ---------------------

   If your HTML document renders in quirksmode (i.e. has no doctype declaration)
   then uncomment the following CSS rule to set a less drastic font-size in IE
*/
div.datePicker table th,
div.datePicker table td {
    font-size: 100%;
}
/* stylelint-enable */
