//
// _card.scss
//

.card {
    box-shadow: $card-box-shadow;
    margin-bottom: $spacer;

    &.card-collapse {
        .card-header {
            border-bottom: 0;
        }
    }

    &[class*="text"]  {
        .card-action-item {
            background-color: rgba(var(--#{$prefix}white-rgb), 0.2) !important;
            color: $white !important;
        }
    }

    .card-title {
        font-size: 15px;
        text-transform: none;
    }

    &.card-bordered {
        border: none;
        border-left: 3px solid;
    }
}

// Custom class for Card backgrouns color
.card-bg {
    background-color: $card-bg;
}

// Card Header
.card-header {
    display: flex;
    align-items: center;
    border-bottom: 1px dashed var(--#{$prefix}border-color); 
    @extend .gap-3;
    @extend .flex-wrap;

    &.border-dashed {
        border-bottom-style: dashed !important;
    }
}

// Custom Card Style
.card-out-of-container {
    margin-left: calc(calc($spacer + $card-border-width) * -1);
    margin-right: calc(calc($spacer + $card-border-width) * -1);
    border-radius: 0;
    border-top: 0;

    html[data-layout="topnav"] & {
        margin-left: 0;
        margin-top: $spacer;
        margin-right: 0;
        border-radius: $card-border-radius;
    }
}

// Card Action
.card-action {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;

    .card-action-item {
        display: inline-block;
        font-size: 16px;
        height: 24px;
        width: 24px;
        line-height: 22px;
        text-align: center;
        border-radius: 50%;
        background-color: rgba(var(--#{$prefix}light-rgb), 0.75);
        color: $gray-700;
        transition: all 0.3s ease-out;

        i {
            vertical-align: middle;
        }

        &:hover {
            background-color: rgba(var(--#{$prefix}primary-rgb), 0.2);
            color: var(--#{$prefix}primary);
        }
    }
}


// Card Overlay
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--#{$prefix}primary-rgb), 0.15);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 0.3rem;
}

// Custom card height
.card-h-100 {
    height: calc(100% - #{$spacer});
}

// Code Body (Custom Component)
.code-body {
    display: none;

    pre {
        max-height: 300px;
        scrollbar-width: thin;
        @extend .bg-light-subtle;
    }
}

// Card Stick Style
.card-top-sticky {
    @extend .position-sticky;
    top: calc(var(--#{$prefix}topbar-height) + $spacer);
}

// Custom Card Tabs Support
.card-tabs {
    border-bottom: 1px solid var(--#{$prefix}border-color) !important;

    .card-header-tabs {
        margin-top: calc(var(--#{$prefix}card-cap-padding-y) * -1);
        border-bottom: 0 !important;
    }

    .nav-link {
        --#{$prefix}nav-link-padding-y: calc(var(--#{$prefix}card-cap-padding-y) + 2px);
    }
}