@import "~cosmoUiVariables";
@import "~cosmoui/src/components/styles/mixins/paddings";
@import "~cosmoui/src/components/styles/mixins/flex";

$job-field-padding: 6px; //times by 2 gives you minimum spacing of 12px
$font-weight-bold: 600;

.ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wrap {
    word-wrap: break-word;
}

.title {
    @extend %row;
}

%field {
    white-space: normal;
    box-sizing: border-box;
    @include padding-x($job-field-padding);
}

// FIELD COLUMN WIDTHS
$job-column-width-frequency: 68px;
$job-column-width-customer: 146px;
$job-column-width-address: 214px;
$job-column-width-tag: 70px;
$job-column-width-act-by: 60px;
$job-column-width-items: 60px;
$job-column-width-smart: 60px;
$job-column-width-courier: 80px;
$job-column-width-info: 250px;

.frequencyField {
    @extend %field;
    width: $job-column-width-frequency;
    flex: 0 0 $job-column-width-frequency;
    padding-left: 20px;
}

.customerField {
    @extend %field;
    width: $job-column-width-customer;
    flex: 0 0 $job-column-width-customer;
}

.stopField {
    @extend %field;
    width: $job-column-width-address;  //overflow hidden requires a definite width
    flex: 0 0 $job-column-width-address;
}

 .stopFieldHeader {
     font-weight: $font-weight-bold;
 }

.tagField {
    @extend %field;
    width: $job-column-width-tag;
    flex: 0 0 $job-column-width-tag;
}

.tagInput {
    width: 35px;
    min-width: 35px;
    padding: 2px;
    font-size: 11px;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: $border-light;
    background-color: inherit;
}
.tagInput:hover {
    border-bottom: $border-dark;
}

%time {
    @extend %field;
    white-space: nowrap;
    width: $job-column-width-act-by;
    font-weight: $font-weight-bold;
    flex: 0 0 $job-column-width-act-by;
}

.timeField {
    @extend %time;
}

.timePositiveField {
    @extend %time;
    color: $available;
}

.timeNegativeField {
    @extend %time;
    color: $unavailable;
}

.itemsField {
    @extend %field;
    font-weight: $font-weight-bold;
    width: $job-column-width-items;
    flex: 0 0 $job-column-width-items;
}

.smartField {
    @extend %field;
    @extend %row;
    font-weight: $font-weight-bold;
    width: $job-column-width-smart;
    flex: 0 0 $job-column-width-smart;
    select {
        box-sizing: border-box;
        width: 45px;
    }
}

.courierField {
    @extend %field;
    width: $job-column-width-courier;
    flex: 0 0 $job-column-width-courier;
    span {
        margin-right: 6px;
    }
}

// EXPANDED WIDTHS
// on the expanded card some of columns occupy multiple columns
// effectively its the equivalent of having colspan

.expandedStopField {
    @extend %field;
    @extend %col;
    // width: $job-column-width-address +  $job-column-width-items; // overflow hidden requires a definite width
    // flex: 0 0 $job-column-width-address +  $job-column-width-items;
    width: $job-column-width-address; // overflow hidden requires a definite width
    flex: 0 0 $job-column-width-address;
}

.time {
    font-weight: bold;
}

// subscription styles

%subscription {
    display: inline-block;
    padding: 4px;
    font-size: 75%;
    font-weight: bold;
    line-height: 1;
    color: $black;
    text-align: center;
    white-space: nowrap;
    border-radius: 5px;
    width: auto;
}

.subscriptionGold {
    @extend %subscription;
    background-color: $color-yellow-500;
}

.subscriptionPlatinum {
    @extend %subscription;
    color: $text-global;
    background-color: $color-gray-400;
}

.subscriptionFive01 {
    @extend %subscription;
    color: $text-global;
    background-color: $color-gray-400;
}

.subscriptionEmpty {
    @extend %subscription;
    background-color: transparent;
    border-color: transparent;
}

.additionalInfoField {
    @extend %field;
    width: $job-column-width-info;
    flex: 0 0 $job-column-width-info;
}

// Priority Styles

%priority {
    display: inline-block;
    padding: 4px;
    font-size: 75%;
    font-weight: bold;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    border-radius: 5px;
    width: auto;
    position: relative;
    &:after {
        content: '';
        position: absolute;
        right: -5px;
        top: 0;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 8px solid $color-orange-700;
    }
}

.priorityHigh {
    @extend %priority;
    background-color: $color-orange-700;
}

.priorityMedium {
    @extend %priority;
    background-color: $color-orange-400;
    &:after {
        border-left-color: $color-orange-400;
    }
}

.priorityLow {
    @extend %priority;
    background-color: $color-orange-200;
    &:after {
        border-left-color: $color-orange-200;
    }
}