.form-group { position: relative; }

/* Dropdown arrow for select elements */
.drop-down-symbol {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.drop-down-symbol::-ms-expand {
    display: none;
}
.input-group-append.custom {
    position: absolute;
    right: 10px;
    top: 36px;
    z-index: 2;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    color: #dc3545;
}
.is-invalid {
    border-color: #dc3545;
}

/* Hide Bootstrap validation background icons on inputs */
.form-control.is-valid,
.form-control.is-invalid,
.was-validated .form-control:valid,
.was-validated .form-control:invalid {
    background-image: none !important;
    padding-right: 0.75rem !important;
}

/* Normalize spacing for validation messages */
.invalid-feedback,
.text-danger {
    margin-top: 4px !important;
}

/* Ensure messages after input groups don't overlap */
.input-group + .invalid-feedback,
.input-group-div + .invalid-feedback {
    margin-top: 4px !important;
}
.preview-container {
    display: flex;
    align-items: center;
    gap: 5px;
}
.preview_img {
    max-width: 100px;
    max-height: 100px;
}
.remove_img {
    color: red;
    cursor: pointer;
    font-size: 20px;
    margin-top: -40px;
}
.card{
        border-color: white;
    }
label{
    font-weight: 600;
}
.form-container {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
}
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    color: #dc3545;
}
.is-invalid {
    border-color: #dc3545;
}
.select2-container {
    width: 100% !important;
}

/* Fix Select2 dropdown hover issue - prevent both selected and hovered from showing same style */
/* Selected option (not being hovered) - light background */
.select2-container--default .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: #e1e1f5 !important;
    color: #131e22 !important;
}

/* Hovered option (whether selected or not) - primary blue */
.select2-container--default .select2-results__option--highlighted {
    background-color: #1b00ff !important;
    color: #fff !important;
}

.text-center {
        text-align: center;
    }
label span {
    color: red;
}

#loader {
    display: none;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.circle-loader {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0; 
    border-top-color: #1b00ff;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fancybox{
    cursor: pointer;
}
.fancybox__backdrop {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(0.5px);   
}
.fancybox__slide img {
    max-width: 850px;
    max-height: 680px;
    width: auto;
    height: auto;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.dataTable:first-of-type thead tr:nth-child(2){
    display: none;
}
table.dataTable.dtr-inline.collapsed>tbody>tr[role="row"]>td:first-child:before, table.dataTable.dtr-inline.collapsed>tbody>tr[role="row"]>th:first-child:before{
    display: none !important;
}
.input-group-prepend{
    width: 140px !important;
}
.edit-btn{
    color: black;
}

.filter-active::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 17px;
    width: 8px;
    height: 8px;
    background-color: #1b00ff;
    border-radius: 50%;
}


.dataTables_paginate {
    top: 4px;
    position: relative;
    left: 22px;
}
.dataTables_info{
    bottom: 15px;
    position: relative;
}

#filterFieldsContainer{
    border-top: 1px solid;
    padding-top: 15px;
}

#filterFieldsContainer{
    margin-top: 8px;
}

.filter-sidebar {
    position: fixed;
    top: 0;
    right: -300px; 
    width: 300px;
    height: 100%;
    background-color: #f8f9fa;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1040;
}

.filter-sidebar.open {
    right: 0;
}

#closeSidebarBtn{
    font-size: 25px;
}

.grid-norec-msg::before {
    margin: 0 auto;
    content: "";
    width: 116px;
    height: 100px;
    display: block;
    background: url(../../images/no-record.png) no-repeat center center !important;
    background-position: 100%;
}


::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  
  ::-webkit-scrollbar-track {
    background: #f1f1f1;    
  }
  
  ::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;   
    border: 2px solid #f1f1f1;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background-color: #555; 
  }
  
  * {
    scrollbar-width: thin; 
    scrollbar-color: #888 #f1f1f1; 
  }
.activity-card{
    height: 88vh;
    display: flex; 
    flex-direction: column;

  }
.activity-entry{
        padding: 10px 0;
    }

    .activity-entry + .activity-entry {
        border-top: 1px solid #e0e0e0;
        margin-top: 5px;
    }

/* Global Search Styles */
.global-search-container {
    position: relative;
    margin-left: 4px;
    margin-top: 4px;
}

.global-search-input {
    height: 36px;
    width: 200px;
    border: 1px solid #5e5e5e;
    padding: 2px 35px 2px 7px;
    border-radius: 3px;
    background: none;
}

.global-search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #666;
    pointer-events: none;
}

    .no-data-msg {
    font-size: 1.1rem;
    font-style: italic;
    padding: 15rem;
}


.detail-link-text {
    color: blue;
}

.add_button {
    margin-left: 7px;
    margin-top: 4px;      
    font-size: 20px;
    border: 1px solid #5e5e5e;
    padding: 2px 7px;
    border-radius: 3px;
    background: none;
}


.delete-btn{
    margin-left:4px;font-size: 20px;
    border: 1px solid #5e5e5e; 
    padding: 2px 7px; 
    border-radius: 3px; 
    background: none
}
.btn.edit_btn{ border: 1px solid var(--border-color) !important;   width: 45px;    height: 45px;  display: flex; align-items: center;
    justify-content: center; border-radius: 6px;}

/* Grid View Styles */
.grid-container {
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 400px;
}

.grid-container .card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.grid-container .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* User Profile Picture in Grid View */
.user-profile-picture-container {
    flex-shrink: 0;
    margin-right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.grid-pagination {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: 0;
    background-color: white;
}

.grid-pagination-wrapper {
    width: 100%;
    padding: 10px 0;
}

.grid-pagination .pagination-info {
    font-size: 14px;
    color: #666;
}

.grid-pagination .pagination-info span {
    font-weight: 600;
    color: #333;
}

.grid-pagination .pagination-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.grid-pagination .pagination-controls .btn {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.grid-pagination .pagination-controls .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.grid-pagination .pagination-controls .btn:hover:not(:disabled) {
    background-color: #f0f0f0;
}

.grid-pagination .pagination-controls .btn.active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.view-toggle-btn {
    cursor: pointer;
}

.view-toggle-btn:hover {
    background-color: #f0f0f0 !important;
}

/* List View Styles */
.list-container {
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 400px;
}

.list-item-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    transition: box-shadow 0.2s, transform 0.2s;
}

.list-item-content-wrapper {
    display: flex;
    align-items: flex-start;
}

.list-item-profile-picture-container {
    flex-shrink: 0;
    margin-right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.list-item-main-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.list-item-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.list-item-title {
    display: flex;
    align-items: center;
    flex: 1;
}

.list-item-title h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-item-actions .badge {
    font-size: 12px;
    padding: 6px 5px;
    font-weight: 500;
    white-space: nowrap;
}

.list-item-body {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    width: 100%;
}

.list-item-detail {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
    max-width: calc(33.333% - 20px);
}

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.detail-value {
    color: #333;
    font-size: 14px;
    font-weight: 400;
}

.list-pagination {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: 0;
    background-color: white;
}

.list-pagination-wrapper {
    width: 100%;
    padding: 10px 0;
}

.list-pagination .pagination-info {
    font-size: 14px;
    color: #666;
}

.list-pagination .pagination-info span {
    font-weight: 600;
    color: #333;
}

.list-pagination .pagination-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.list-pagination .pagination-controls .btn {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.list-pagination .pagination-controls .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.list-pagination .pagination-controls .btn:hover:not(:disabled) {
    background-color: #f0f0f0;
}

.list-pagination .pagination-controls .btn.active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Footer spacing - prevent overlap with content */
.main-container {
    padding-bottom: 100px !important;
}

/* Additional spacing for listing pages */
.pd-ltr-20 {
    padding-bottom: 100px;
}

/* Ensure card-box and list containers have bottom spacing */
.card-box,
.list-container {
    margin-bottom: 30px;
}

/* Additional spacing for pagination and last elements */
.list-pagination,
.grid-pagination {
    margin-bottom: 30px;
}

/* Ensure body has enough bottom padding for fixed footer */
body {
    padding-bottom: 0;
}

/* Add extra spacing to min-height container */
.min-height-200px {
    padding-bottom: 40px;
}

/* Footer styling - ensure it doesn't overlap content */
footer {
    padding: 5px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px 0 0 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* Ensure footer container has proper spacing */
div[style*="position: fixed"][style*="bottom"] {
    z-index: 1000;
    padding-right: 20px;
}

/* View Toggle Dropdown Styles */
.view-toggle-btn.dropdown-toggle::after {
    display: none;
}

.dropdown-menu .view-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
}

.dropdown-menu .view-option:hover {
    background-color: #f8f9fa;
}

.dropdown-menu .view-option.active {
    background-color: #e7f3ff;
    color: #007bff;
    font-weight: 500;
}

.dropdown-menu .view-option i {
    width: 20px;
}

/* Collapsed sidebar: keep icons visible and show flyout labels/submenus */
@media (min-width:1301px) {
    body.sidebar-shrink .left-side-bar,
    body.sidebar-shrink .left-side-bar.open {
        width: 78px;
        left: 0;
        overflow: visible;
    }

    body.sidebar-shrink .left-side-bar .brand-logo a {
        padding: 12px 0;
        text-align: center;
    }

    body.sidebar-shrink .left-side-bar .brand-logo img {
        max-width: 52px;
        margin: 0 auto;
    }

    body.sidebar-shrink .left-side-bar .menu-block {
        overflow: visible;
    }

    body.sidebar-shrink .header {
        width: calc(100% - 78px);
        left: 78px;
    }

    body.sidebar-shrink .main-container {
        padding-left: 98px;
    }

    body.sidebar-shrink .sidebar-menu .dropdown-toggle,
    body.sidebar-shrink .sidebar-menu > ul > li > a {
        padding: 25px 25px;
        text-align: center;
    }

    body.sidebar-shrink .sidebar-menu .dropdown-toggle .micon {
        left: 50%;
        transform: translate(-50%, -50%);
        width: 52px;
        height: 52px;
        font-size: 28px;
    }

    body.sidebar-shrink .sidebar-menu .mtext {
        display: none;
    }

    body.sidebar-shrink .sidebar-menu .dropdown-toggle:after {
        display: none;
    }

    body.sidebar-shrink .sidebar-menu > ul > li {
        position: relative;
        padding: 6px 12px;
    }

    /* Tooltip for single-level items */
    body.sidebar-shrink .sidebar-menu > ul > li > a::after {
        content: attr(data-title);
        position: absolute;
        left: 76px;
        top: 50%;
        transform: translateY(-50%);
        background: #142127;
        color: #fff;
        padding: 8px 12px;
        border-radius: 6px;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        z-index: 1100;
        pointer-events: none;
    }

    body.sidebar-shrink .sidebar-menu > ul > li:hover > a::after {
        opacity: 1;
        visibility: visible;
    }

    /* Prevent duplicate tooltip when submenu flyout is present */
    body.sidebar-shrink .sidebar-menu > ul > li.has-children > a::after {
        display: none;
    }

    /* Flyout submenu */
    body.sidebar-shrink .sidebar-menu > ul > li > .submenu {
        /* Override inline display:none added by accordion JS so flyout can show on hover */
        display: block !important;
        position: absolute;
        left: 78px;
        top: 0;
        min-width: 220px;
        background: #142127;
        border-radius: 8px;
        padding: 8px 0 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        z-index: 1099;
    }

    body.sidebar-shrink .sidebar-menu > ul > li:hover > .submenu {
        opacity: 1;
        visibility: visible;
    }

    body.sidebar-shrink .sidebar-menu > ul > li > .submenu::before {
        content: attr(data-parent-title);
        display: block;
        padding: 10px 14px 6px;
        font-weight: 600;
        color: #fff;
        opacity: 0.75;
        font-size: 13px;
    }

    body.sidebar-shrink .sidebar-menu > ul > li > .submenu li a {
        padding: 10px 14px 10px 18px;
        text-align: left;
    }
}
