/* Shared Sidebar and Global Styles */

/* Global Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Global Detail Label Styles */
.detail-label {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    line-height: 1.4;
    display: block;
    clear: both;
    letter-spacing: 0.02em;
}

.detail-label + p,
.detail-label + div,
.detail-label + input,
.detail-label + textarea {
    margin-bottom: 0.7rem;
    line-height: 1.5;
    color: #495057;
}

/* Mobile responsive for detail labels */
@media (max-width: 768px) {
    .detail-label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .detail-label + p,
    .detail-label + div,
    .detail-label + input,
    .detail-label + textarea {
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }
}

/* Mobile Header */
.mobile-header {
    background-color: #212529;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.mobile-header .btn {
    color: white;
    padding: 0;
    margin-right: 15px;
}

.mobile-title {
    margin: 0;
    font-size: 1.2rem;
}

/* Sidebar Styles */
.sidebar {
    background-color: #212529;
    color: white;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

#sidebarContainer {
    padding: 0;
    margin: 0;
}

.sidebar-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-sidebar {
    color: white;
    padding: 0;
    display: none;
}

.sidebar-header h3 {
    margin: 0;
}

.sidebar-header a {
    text-decoration: none;
    color: inherit;
}

#client-management-title {
    margin: 0;
    font-size: 1.4rem;
    background: linear-gradient(to right,
            #ff0000,
            #ff7f00,
            #ffff00,
            #00ff00,
            #0000ff,
            #4b0082,
            #9400d3,
            #00ff00,
            #ffff00,
            #ff7f00,
            #ff0000);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow 12s linear infinite;
    background-size: 200% auto;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 12px 15px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: #343a40;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content Styles */
.main-content {
    padding: 20px;
    position: relative;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.content-header h2 {
    margin: 0;
}

.search-container {
    position: relative;
    display: inline-block;
}

.search-container input {
    padding-left: 35px; /* Make room for clear icon */
    padding-right: 35px; /* Make room for search icon */
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.clear-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    padding: 5px;
}

.clear-icon:hover {
    color: #dc3545;
}

/* Table Styles */
.table {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.table th {
    background-color: #f8f9fa;
    cursor: pointer;
}

.table th i {
    margin-left: 5px;
    color: #adb5bd;
}

.table th i.active {
    color: #212529;
}

.table td {
    vertical-align: middle;
}

.action-buttons button {
    margin-right: 5px;
}

/* Modal Styles */
.modal-content {
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-dialog.modal-xl {
    max-width: 85%;
    margin: 1.75rem auto;
}

/* .modal-dialog.modal-xl .modal-content {
    min-height: calc(100vh - 3.5rem);
} */

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Responsive Modal Adjustments */
@media (max-width: 1200px) {
    .modal-dialog.modal-xl {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .modal-dialog.modal-xl {
        max-width: 95%;
        height: 100vh;
    }

    .modal-dialog.modal-xl .modal-content {
        /* min-height: 100vh; */
        border-radius: 0;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }
}

/* Form Layout in Modal */
.modal-body .row {
    margin: 0 -0.75rem;
}

.modal-body .col-md-6 {
    padding: 0 0.75rem;
}

@media (max-width: 768px) {
    .modal-body .row {
        margin: 0 -0.5rem;
    }

    .modal-body .col-md-6 {
        padding: 0 0.5rem;
    }
}

/* Form Styles */
.form-label {
    font-weight: 500;
}

/* Button Styles */
.btn-primary {
    background-color: #212529;
    border-color: #212529;
}

.btn-primary:hover {
    background-color: #343a40;
    border-color: #343a40;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #ced4da;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
        margin-top: 10px;
        margin-left: 0;
    }

    .dashboard-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 12px;
        margin-bottom: 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 1040;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .close-sidebar {
        display: block;
    }

    .main-content {
        margin-top: 60px;
    }

    .content-header {
        padding: 8px 12px;
        margin-bottom: 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        gap: 8px;
    }
}

/* Action Bar Styles */
.action-bar {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.action-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.action-left .btn {
    white-space: nowrap;
}

.action-left .dropdown {
    margin-left: 0;
}

#totalRecordsCount {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .action-bar {
        padding: 12px;
    }

    .action-left {
        gap: 8px;
    }

    .action-left .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }

    #totalRecordsCount {
        font-size: 0.9rem;
        margin-top: 8px;
        width: 100%;
    }

    .dropdown-menu {
        min-width: 200px;
    }
}

@media (max-width: 576px) {
    .action-bar {
        padding: 10px;
    }

    .action-left {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .action-left .btn {
        width: 100%;
        justify-content: center;
    }

    .action-left .dropdown {
        width: 100%;
    }

    .action-left .dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    #totalRecordsCount {
        text-align: center;
        justify-content: center;
    }
}

/* Loading State Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 245, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-component {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 245, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 5px;
}

.loading-text {
    margin-top: 15px;
    font-size: 18px;
    color: #333;
}

.loading-text-component {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
}

.progress-container {
    width: 300px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #007BFF;
    width: 0%;
    border-radius: 4px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

.progress-container-component {
    width: 200px;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar-component {
    height: 100%;
    background-color: #007BFF;
    width: 0%;
    border-radius: 4px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

.button-loading {
    position: relative;
    pointer-events: none;
}

.button-loading .spinner-border {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    border-width: 2px;
}

@keyframes progress-animation {
    0% {
        width: 0%;
    }

    50% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
    pointer-events: none;
}

.toast {
    margin-bottom: 10px;
    overflow: hidden;
    font-size: 0.875rem;
    background-clip: padding-box;
    border-radius: 10px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.2s ease-in;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-clip: padding-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-body {
    padding: 0.75rem;
}

/* Error Toast Styles */
.toast.error {
    background-color: #D32F2F;
    color: #FFFFFF;
    border: none;
}

.toast.error .toast-header {
    background-color: rgba(0, 0, 0, 0.1);
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.error .toast-header strong {
    font-weight: bold;
}

.toast.error .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

.toast.error .btn-close:hover {
    opacity: 1;
}

.toast.error .toast-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Success Toast Styles */
.toast.success {
    background-color: #28a745;
    color: #FFFFFF;
    border: none;
}

.toast.success .toast-header {
    background-color: rgba(0, 0, 0, 0.1);
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success .toast-header strong {
    font-weight: bold;
}

.toast.success .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

.toast.success .btn-close:hover {
    opacity: 1;
}

.toast.success .toast-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Dashboard Button */
.dashboard-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #212529;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 15px;
    font-size: 1.2rem;
}

.dashboard-btn:hover {
    background-color: #0d6efd;
    color: white;
    transform: translateY(-2px);
}

.logo-img {
    max-height: 40px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Compact table cells and responsive table */
.table th,
.table td {
    padding: 0.4rem 0.6rem;
    font-size: 0.97rem;
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 180px;
}

.table-responsive {
    overflow-x: auto;
}

.table td,
.table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
        margin-top: 10px;
        margin-left: 0;
    }

    .dashboard-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-left: 0;
    }
} 