/* ----------------------------------------------------------------------------
 * Bookmarx - Simple Bookmark Manager
 *
 * @package     Bookmarx
 * @author      A.Tselegidis <alextselegidis@gmail.com>
 * @copyright   Copyright (c) Alex Tselegidis
 * @license     https://opensource.org/licenses/GPL-3.0 - GPLv3
 * @link        https://github.com/alextselegidis/bookmarx
 * ---------------------------------------------------------------------------- */
/* Global transition for smooth effects */
*,
*::before,
*::after {
    transition: background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out,
    color 0.15s ease-in-out,
    opacity 0.15s ease-in-out;
}

/* Override Bootstrap primary color */
:root {
    --bs-primary: #3e5375;
    --bs-primary-rgb: 62, 83, 117;
    --bs-link-color: #3e5375;
    --bs-link-color-rgb: 62, 83, 117;
    --bs-link-hover-color: #2d3d56;
    --bs-link-hover-color-rgb: 45, 61, 86;
    --bs-secondary-color: #6c757d;
    --bs-body-color: #495057;
}

/* Link colors - darker than labels */
a {
    color: var(--bs-link-color);
}

a:hover {
    color: var(--bs-link-hover-color);
}

/* Labels use a different color */
.form-label {
    color: #495057 !important;
}

.text-dark {
    color: #343a40 !important;
}

.btn-primary {
    --bs-btn-bg: #3e5375;
    --bs-btn-border-color: #3e5375;
    --bs-btn-hover-bg: #2d3d56;
    --bs-btn-hover-border-color: #263447;
    --bs-btn-active-bg: #263447;
    --bs-btn-active-border-color: #1f2b3a;
    --bs-btn-disabled-bg: #3e5375;
    --bs-btn-disabled-border-color: #3e5375;
}

.btn-outline-primary {
    --bs-btn-color: #3e5375;
    --bs-btn-border-color: #3e5375;
    --bs-btn-hover-bg: #3e5375;
    --bs-btn-hover-border-color: #3e5375;
    --bs-btn-active-bg: #3e5375;
    --bs-btn-active-border-color: #3e5375;
}

.btn-dark {
    --bs-btn-bg: #333333;
    --bs-btn-border-color: #333333;
    --bs-btn-hover-bg: #222222;
    --bs-btn-hover-border-color: #1a1a1a;
    --bs-btn-active-bg: #1a1a1a;
    --bs-btn-active-border-color: #111111;
    --bs-btn-disabled-bg: #333333;
    --bs-btn-disabled-border-color: #333333;
}

.bg-primary {
    background-color: #3e5375 !important;
}

/* Dashboard card image gradient background */
.card .card-img-top {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* Improved card footer styling - subtle warm gray */
.card .card-footer {
    background-color: #f5f5f5 !important;
    border-top-color: #e8e8e8 !important;
}

/* Improved background colors - warmer and softer */
.bg-light {
    background-color: #fafafa !important;
}

.bg-body-secondary {
    background-color: #f5f5f5 !important;
}

.bg-body-tertiary {
    background-color: #f8f8f8 !important;
}

/* Main layout background - softer */
.main-layout {
    background-color: #f5f6f8 !important;
}

.text-muted {
    color: #6c757d !important;
}

.text-body-secondary {
    color: #6c757d !important;
}

/* Responsive width utilities for lg breakpoint */
@media (min-width: 992px) {
    .w-lg-auto {
        width: auto !important;
    }

    .flex-lg-grow-0 {
        flex-grow: 0 !important;
    }

    .rounded-lg-3 {
        border-radius: var(--bs-border-radius-lg) !important;
    }

    .shadow-lg-sm {
        box-shadow: var(--bs-box-shadow-sm) !important;
    }

    .min-vh-lg-auto {
        min-height: auto !important;
    }

    .table-responsive {
        overflow: visible;
    }
}

/* Card hover effect */
.card-hover-move {
    transition: transform 0.2s ease-in-out,
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.card-hover-move:hover {
    transform: translateY(-2px);
}

/* Link image styling - stretch for og_image, contain for favicon */
.card .card-img-top.img-cover {
    object-fit: cover;
}

.card .card-img-top.img-contain {
    object-fit: contain;
}

/* Equal width buttons */
.btn-equal-width {
    min-width: 120px;
}

/* Better button styling */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Clean table design */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table > :not(caption) > * > * {
    border-bottom-width: 1px;
    border-bottom-color: #e9ecef;
}

/* Remove last row border */
.table > tbody > tr:last-child > * {
    border-bottom: 0;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #fafafa;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f5f5f5;
}

/* Light gray table header */
.table-light-header > thead {
    background-color: #f8f9fa;
}

.table-light-header > thead > tr > th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: normal;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.15s ease-in-out;
}

.table-light-header > thead > tr > th:has(a):hover {
    background-color: #e9ecef;
}

.table-light-header > thead > tr > th a {
    color: #495057;
}

.table-light-header > thead > tr > th a:hover {
    color: #212529;
}

/* Card with table - zero padding on card-body */
.card-table > .card-body {
    padding: 0;
}

/* Filter/search section above table */
.card-table .table-filters {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* Pagination section below table */
.card-table .table-pagination {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Fix pagination styling */
.pagination {
    gap: 0.25rem;
}

.pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    color: #333;
    background-color: #ededed;
    border-color: #ededed;
}

.pagination .page-item .page-link:hover {
    color: #3e5375;
    background-color: #f8f9fa;
    border-color: #3e5375;
}

.pagination .page-item.active .page-link {
    color: #fff;
    background-color: #333;
    border-color: #333;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

.pagination .page-item .page-link i {
    font-size: 0.75rem;
}

@media (min-width: 992px) {
    .navbar-nav .nav-item .nav-link.nav-menu-item {
        min-width: 120px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding-top: 1rem;
        padding-bottom: 1rem;
        transition: background-color 0.2s ease;
    }

    .navbar-nav .nav-item .nav-link.nav-menu-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .navbar {
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar-brand {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Table header sorting hover effect */
.table-dark th a {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
}

.table-dark th {
    vertical-align: middle;
}

.table-dark th a:hover {
    opacity: 0.8;
}

.table-dark th a::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    margin-left: 0.5rem;
    opacity: 0;
    font-size: 0.75rem;
    transition: opacity 0.15s ease-in-out;
}

.table-dark th a:hover::after {
    opacity: 0.6;
}
