/* Overriding bootstrap defaults */
$primary-900: hsl(213, 98%, 90%);
$primary-800: hsl(217, 94%, 80%);
$primary-700: hsl(221, 87%, 77%);
$primary-600: hsl(225, 81%, 68%);
$primary: hsl(229, 71%, 57%);
$primary-400: hsl(234, 59%, 50%);
$primary-300: hsl(237, 44%, 45%);
$primary-200: hsl(242, 40%, 40%);
$primary-100: hsl(247, 35%, 25%);

$gray-900: hsl(204, 12%, 95%) !default;
$gray-800: hsl(210, 12%, 86%) !default;
$gray-700: hsl(214, 12%, 74%) !default;
$gray-600: hsl(211, 12%, 67%) !default;
$gray-500: hsl(214, 12%, 50%) !default;
$gray-400: hsl(216, 12%, 43%) !default;
$gray-300: hsl(218, 12%, 27%) !default;
$gray-200: hsl(218, 12%, 21%) !default;
$gray-100: hsl(220, 12%, 11%) !default;
$gray-50: hsl(220, 12%, 6%) !default;

/* :) */

$theme-colors: (
    "gray-50": $gray-50,
    "gray-100": $gray-100,
    "gray-200": $gray-200,
    "gray-300": $gray-300,
    "gray-400": $gray-400,
    "gray-500": $gray-500,
    "gray-600": $gray-600,
    "gray-700": $gray-700,
    "gray-800": $gray-800,
    "gray-900": $gray-900,

    "primary-100": $primary-100,
    "primary-200": $primary-200,
    "primary-300": $primary-300,
    "primary-400": $primary-400,
    "primary-600": $primary-600,
    "primary-700": $primary-700,
    "primary-800": $primary-800,
    "primary-900": $primary-900
);

$spacer: 1rem;
$spacers: (
    0: 0,
    1: ($spacer * .25),
    2: ($spacer * .5),
    3: $spacer,
    4: ($spacer * 1.5),
    5: ($spacer * 3),
    6: ($spacer * 4),
    7: ($spacer * 5),
    8: ($spacer * 6),
    9: ($spacer * 8),
    10: ($spacer * 10)
);

/* Overriding */
$white: hsl(220, 7%, 8%);
$black: #fff;
$text-muted: $gray-500;

$body-bg: hsl(222, 15%, 5%);
$body-color: $gray-800;

$yiq-text-dark: $gray-100;
$yiq-text-light: $black;

$nav-pills-link-active-bg: $gray-900;
$list-group-border-color: $gray-100;

$modal-backdrop-bg: black;

/* Code */
$code-color: $primary;

/* Border */
$border-radius: .5rem;
$border-radius-lg: $border-radius;
$border-radius-sm: $border-radius;
$card-border-radius: $border-radius * 2;

/* Dropdown */
$dropdown-padding-x: .5rem;
$dropdown-padding-y: .5rem;
$dropdown-item-padding-y: .5rem;
$dropdown-border-color: $gray-100;
$dropdown-divider-bg: $gray-100;

/* Card */
$card-border-color: $gray-100;

/* Pagination */
$pagination-border-color: $gray-100;
$pagination-disabled-border-color: $gray-100;
$pagination-hover-bg: $gray-50;
$pagination-hover-border-color: $gray-100;

/* Inputs */
$input-border-color: $gray-200;
$input-color: $gray-700;
$input-placeholder-color: $gray-500;
$input-btn-padding-y: .45rem;
$input-btn-padding-x: .75rem;
$form-group-margin-bottom: 1.5rem;
$input-group-addon-bg: $gray-100;

/* Blockquote footer */
$blockquote-small-color: $gray-800;

/* Small font size */
$small-font-size: 80%;

/* Tooltips */
$tooltip-padding-y: .6rem;
$tooltip-padding-x: .9rem;

/* Navbar color contrast compliance fixes */
$navbar-dark-color:                 $gray-600;
$navbar-dark-hover-color:           $gray-700;
$navbar-light-color:                $gray-600;
$navbar-light-hover-color:          $gray-700;

/* Improve green color */
$green: #5ec269;

@import "./bootstrap-rtl/bootstrap-rtl";

/* a */
a:not(.dropdown-item):not(.btn):not(.nav-link) {
    transition: color .3s linear !important;
}

/* Dropdown */
.dropdown-toggle-simple::after {
    display:none;
}

/* Gap utilities */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

.dropdown-item > svg {
    color: $gray-700;
}

.dropdown-item:focus > svg {
    color: inherit;
}

/* Animate dropdown menu */
.dropdown .dropdown-menu{
    animation-name: opacityIn;
    animation-duration: .15s;
}

@keyframes opacityIn {
    from { opacity: .3; }
    to { opacity: 1; }
}

/* Nav pills */
.nav-pills {
    .nav-link {
        color: $gray-900;
    }
}

/* Code */
code {
    background: $primary-100;
    border-radius: $border-radius;
    padding: .15rem .4rem;
}

/* Buttons */
.btn {
    border-style: solid;
}
.btn:not([class*="outline"]) {
    border-color: transparent;
}

/* Tooltip fix */
.tooltip { top: 0; }

/* Stretched link fix - otherwise leaks on top of dropdown menu */
.stretched-link::after {
    z-index: 0 !important;
}

/* Custom switches */
.custom-control-label::before {
    border: 0;
    background: #{$gray-200};
}
.custom-control-input[disabled]~.custom-control-label::before, .custom-control-input:disabled~.custom-control-label::before {
    background: #{$gray-300};
}

/* Badges */
.badge {
    padding: 0.45em 0.9em;
}
[data-theme-style="dark"] .badge-primary {
    background: var(--primary-800);
    color: var(--primary-100);
}
[data-theme-style="dark"] .badge-secondary {
    background-color: hsl(208, 7%, 35%);
    color: hsl(208, 7%, 85%);
}
[data-theme-style="dark"] .badge-success {
    background-color: hsla(134, 50%, 30%, 1);
    color: hsla(134, 50%, 85%, 1);
}
[data-theme-style="dark"] .badge-danger {
    background-color: hsla(354, 70%, 35%, 1);
    color: hsla(354, 70%, 85%, 1);
}
[data-theme-style="dark"] .badge-warning {
    background-color: hsla(50, 10%, 20%, 1);
    color: hsla(45, 100%, 85%, 1);
}
[data-theme-style="dark"] .badge-info {
    background-color: hsla(188, 60%, 30%, 1);
    color: hsla(188, 78%, 85%, 1);
}
[data-theme-style="dark"] .badge-light {
    background-color: hsla(210, 15%, 20%, 1);
    color: hsl(210, 17%, 95%);
}
[data-theme-style="dark"] .badge-dark {
    background-color: hsla(210, 10%, 90%, 1);
    color: hsla(210, 10%, 20%, 1);
}

// DARK //

/* Extra variables */
:root {
    color-scheme: dark;
    --black: #{$black};
    --body-bg: #{$body-bg};
    --body-color: #{$body-color};
    --border-radius: #{$border-radius};
    --input-border-color: #{$input-border-color};
    --input-color: #{$input-color};
    --input-placeholder-color: #{$input-placeholder-color};
    --input-padding-y: #{$input-btn-padding-y};
    --input-padding-x: #{$input-btn-padding-x};
    --input-font-size: #{$input-font-size};
    --card-padding: #{$card-spacer-x};
}
