/* Enhanced UI Components for Kaak-media Admin Dashboard
-------------------------------------------------- */

/* Background Colors with opacity */
.bg-primary-soft {
    background-color: rgba(78, 115, 223, 0.1);
}

.bg-secondary-soft {
    background-color: rgba(108, 117, 125, 0.1);
}

.bg-success-soft {
    background-color: rgba(40, 167, 69, 0.1);
}

.bg-info-soft {
    background-color: rgba(23, 162, 184, 0.1);
}

.bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.1);
}

.bg-danger-soft {
    background-color: rgba(220, 53, 69, 0.1);
}

.bg-light-soft {
    background-color: rgba(248, 249, 250, 0.5);
}

.bg-dark-soft {
    background-color: rgba(52, 58, 64, 0.1);
}

/* Icon Circle */
.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

.icon-circle.sm {
    width: 2rem;
    height: 2rem;
}

.icon-circle.lg {
    width: 4rem;
    height: 4rem;
}

/* Cards with Left Border */
.card.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.card.border-left-secondary {
    border-left: 0.25rem solid #6c757d !important;
}

.card.border-left-success {
    border-left: 0.25rem solid #28a745 !important;
}

.card.border-left-info {
    border-left: 0.25rem solid #17a2b8 !important;
}

.card.border-left-warning {
    border-left: 0.25rem solid #ffc107 !important;
}

.card.border-left-danger {
    border-left: 0.25rem solid #dc3545 !important;
}

/* Enhanced Breadcrumb */
.page-header-breadcrumb {
    padding: 1rem;
    border-radius: 0.35rem;
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
}

.breadcrumb {
    margin-bottom: 0;
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #b7b9cc;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4e73df;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.back-to-top:hover {
    background-color: #2e59d9;
    color: white;
}

.back-to-top.visible {
    opacity: 1;
}

/* Enhanced Navigation Pills */
.nav-pills .nav-link {
    border-radius: 0.25rem;
    color: #5a5c69;
    transition: all 0.2s;
}

.nav-pills .nav-link:hover {
    color: #4e73df;
    background-color: rgba(78, 115, 223, 0.1);
}

.nav-pills .nav-link.active {
    background-color: #4e73df;
    color: #fff;
    box-shadow: 0 2px 5px rgba(78, 115, 223, 0.2);
}

/* Enhanced Tables */
.table-enhanced {
    border-collapse: separate;
    border-spacing: 0;
}

.table-enhanced thead th {
    border-top: none;
    background-color: #f8f9fc;
    color: #6e707e;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.table-enhanced tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

/* Enhanced Alerts */
.alert {
    border: none;
    border-left: 0.25rem solid;
    border-radius: 0.35rem;
}

.alert-primary {
    background-color: rgba(78, 115, 223, 0.1);
    border-left-color: #4e73df;
    color: #2653d4;
}

.alert-secondary {
    background-color: rgba(108, 117, 125, 0.1);
    border-left-color: #6c757d;
    color: #5a6268;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #1e7e34;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
    color: #117a8b;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #d39e00;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #bd2130;
}

/* Form Controls */
.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Custom Badge */
.badge-soft-primary {
    color: #4e73df;
    background-color: rgba(78, 115, 223, 0.1);
}

.badge-soft-secondary {
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
}

.badge-soft-success {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.badge-soft-danger {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.badge-soft-warning {
    color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.badge-soft-info {
    color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
}

/* Custom Progress Bars */
.progress {
    height: 0.6rem;
    border-radius: 0.25rem;
}

.progress-sm {
    height: 0.4rem;
}

.progress-lg {
    height: 1rem;
}

/* Custom Buttons */
.btn-circle {
    border-radius: 100%;
    height: 2.5rem;
    width: 2.5rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-circle.btn-sm {
    height: 1.8rem;
    width: 1.8rem;
    font-size: 0.75rem;
}

.btn-circle.btn-lg {
    height: 3.5rem;
    width: 3.5rem;
    font-size: 1.35rem;
}

/* Custom Card Hover */
.card-hover {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* CSS Variables for Standardized Colors */
:root {
    --primary: #4e73df;
    --primary-dark: #2e59d9;
    --primary-light: #bac8f3;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fc;
    --dark: #5a5c69;
    
    --primary-soft: rgba(78, 115, 223, 0.1);
    --secondary-soft: rgba(108, 117, 125, 0.1);
    --success-soft: rgba(40, 167, 69, 0.1);
    --info-soft: rgba(23, 162, 184, 0.1);
    --warning-soft: rgba(255, 193, 7, 0.1);
    --danger-soft: rgba(220, 53, 69, 0.1);
    --light-soft: rgba(248, 249, 250, 0.5);
    --dark-soft: rgba(52, 58, 64, 0.1);
}

/* Dark Mode Support */
body.dark-mode {
    background-color: #1a1c23;
    color: #e4e6f1;
}

body.dark-mode .card,
body.dark-mode .list-group-item,
body.dark-mode .page-header-breadcrumb,
body.dark-mode .form-control,
body.dark-mode .input-group-text {
    background-color: #252833;
    border-color: #2d3142;
    color: #e4e6f1;
}

body.dark-mode .text-muted {
    color: #a9adc1 !important;
}

body.dark-mode .card-header,
body.dark-mode .card-footer {
    background-color: #20222b;
    border-color: #2d3142;
}

body.dark-mode .table {
    color: #e4e6f1;
}

body.dark-mode .table-enhanced thead th {
    background-color: #1a1c23;
}

body.dark-mode .table-enhanced tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background-color: #5a6268;
    transform: scale(1.1);
}

/* Animation Effects */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-in-out;
}

.slide-down {
    animation: slideDown 0.5s ease-in-out;
}

.slide-left {
    animation: slideLeft 0.5s ease-in-out;
}

.slide-right {
    animation: slideRight 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideLeft {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideRight {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading State for Form Submissions */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.spinner-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.spinner-border {
    margin-bottom: 15px;
}

/* Responsive Utilities */
@media (max-width: 991.98px) {
    .d-lg-up-none {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .d-lg-down-none {
        display: none !important;
    }
}

/* Form Validation Enhanced */
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.invalid-feedback, .valid-feedback {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Standardized Section Headers */
.section-header {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary);
}

.section-header.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}
