/**
 * Common styles for INPA application
 */
#avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.login-img {
    width: 850px;
    height: 600px;
}

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

.loading-spinner {
    text-align: center;
    color: white;
}

    .loading-spinner .spinner-border {
        width: 3rem;
        height: 3rem;
    }

    .loading-spinner p {
        font-size: 1.1rem;
        font-weight: 500;
    }

/* Language Switch Toggle Styles */
.language-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
}

    .language-switch .flag-icon {
        font-size: 24px;
        cursor: pointer;
        opacity: 0.5;
        transition: all 0.3s ease;
        user-select: none;
    }

        .language-switch .flag-icon.active {
            opacity: 1;
            transform: scale(1.1);
        }

        .language-switch .flag-icon:hover {
            transform: scale(1.15);
        }

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #b2d600;
    transition: 0.4s;
    border-radius: 24px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

input:checked + .slider {
    background-color: #b2d600;
}

    input:checked + .slider:before {
        transform: translateX(26px);
    }

.slider:hover {
    background-color: #999;
}

input:checked + .slider:hover {
    background-color: #1500cc;
}

/* Language Dropdown (Figma-style override for header) */
.language-switch {
    position: relative;
}

    .language-switch .btn-language {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        color: #333333;
        text-decoration: none;
        background-color: #ffffff;
        padding: 8px 16px;
        border-radius: 6px;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        transition: all 0.2s ease;
    }

        .language-switch .btn-language:hover {
            background-color: #f8f9fa;
            border-color: #d0d0d0;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
            text-decoration: none;
            color: #333333;
        }

    .language-switch .language-flag-icon {
        width: 20px;
        height: 15px;
        border-radius: 2px;
        display: inline-block;
    }

    .language-switch .language-name {
        font-weight: 500;
        font-size: 14px;
    }

    .language-switch .btn-language i {
        font-size: 12px;
        margin-left: 4px;
        transition: transform 0.3s ease;
    }

        .language-switch .btn-language i.rotate-up {
            transform: rotate(180deg);
        }

.language-dropdown-menu {
    min-width: 250px;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    position: absolute;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

    .language-dropdown-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 14px;
        padding: 10px 16px;
        color: #666666;
        transition: background-color 0.2s ease;
    }

        .language-dropdown-menu .dropdown-item .language-code {
            font-weight: 600;
            color: #3b82f6;
            font-size: 13px;
            min-width: 24px;
        }

        .language-dropdown-menu .dropdown-item .language-flag-icon {
            width: 24px;
            height: 18px;
            border-radius: 2px;
            display: inline-block;
        }

        .language-dropdown-menu .dropdown-item .language-item-name {
            color: #666666;
            font-size: 14px;
        }

        .language-dropdown-menu .dropdown-item:hover {
            background-color: #f5f5f5;
            text-decoration: none;
        }

        .language-dropdown-menu .dropdown-item.active {
            background-color: #dbeafe;
        }

            .language-dropdown-menu .dropdown-item.active:hover {
                background-color: #bfdbfe;
            }

/* Login Title Styles */
.login-logo {
    width: 120px;
    height: auto;
    animation: fadeInDown 0.8s ease-out;
}

.inpa-title {
    font-size: 32px;
    font-weight: 700;
    color: #b2d600;
    letter-spacing: 2px;
    margin-bottom: 8px;
    animation: fadeInUp 0.8s ease-out;
    text-transform: uppercase;
}

.inpa-subtitle {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    animation: fadeInUp 1s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header .col-md-6.text-right {
        text-align: left !important;
        margin-top: 15px;
    }

    .btn-lg {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive styles for iPad */
@media (min-width: 768px) and (max-width: 1024px) {
    .login-img {
        width: 100%;
        height: 450px;
        object-fit: cover;
    }

    .login-box {
        padding: 40px 30px !important;
        margin-top: 20px;
    }

    .login-logo {
        width: 100px;
    }

    .inpa-title {
        font-size: 28px;
        letter-spacing: 1.8px;
    }

    .inpa-subtitle {
        font-size: 13px;
    }

    .login-title {
        margin-bottom: 30px;
    }

    .form-control-lg {
        font-size: 15px;
        padding: 12px 15px;
    }

    .input-group-text {
        padding: 12px 15px;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Adjust language switch for iPad */
    .language-switch .btn-language {
        padding: 10px 16px;
        font-size: 14px;
    }

    .language-switch .language-flag-icon {
        width: 24px;
        height: 18px;
    }
}

/* Dropdown Performance Optimization */
.dropdown-menu {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.dropdown-item {
    transition: background-color 0.1s ease-in-out !important; /* Faster transition */
}

/* Notification optimization */
.notification-list ul li a {
    transition: background-color 0.1s ease-in-out !important;
}

    .notification-list ul li a img {
        transition: none !important; /* Remove image transitions */
    }

/* Lazy loaded images */
img[data-src] {
    background: #f8f9fa;
    min-height: 50px;
    width: 50px;
}

/* Notification Styles */
.notification-icon {
    font-size: 24px;
    margin-right: 12px;
    display: inline-block;
    vertical-align: middle;
}

/* Responsive styles for mobile */
@media (max-width: 767px) {
    .login-img {
        height: 395px;
    }

    .login-logo {
        width: 80px;
    }

    .inpa-title {
        font-size: 24px;
        letter-spacing: 1.5px;
    }

    .inpa-subtitle {
        font-size: 12px;
    }

    .dashboard-setting {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
    }

    .language-switch .btn-language {
        padding: 8px 14px;
        font-size: 14px;
        gap: 8px;
    }

    .language-switch .language-flag-icon {
        width: 22px;
        height: 16px;
    }

    .language-switch .language-name {
        display: none;
    }

    .language-switch .btn-language i {
        margin-left: 0;
        font-size: 13px;
    }

    .language-dropdown-menu {
        min-width: 240px;
    }

        .language-dropdown-menu .dropdown-item {
            padding: 12px 16px;
            gap: 12px;
            font-size: 14px;
        }

            .language-dropdown-menu .dropdown-item .language-code {
                font-size: 13px;
                font-weight: 600;
                min-width: 28px;
            }

            .language-dropdown-menu .dropdown-item .language-flag-icon {
                width: 24px;
                height: 18px;
            }

            .language-dropdown-menu .dropdown-item .language-item-name {
                font-size: 14px;
            }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575px) {
    .language-switch .btn-language {
        padding: 8px 12px;
        font-size: 13px;
    }

    .language-switch .language-flag-icon {
        width: 20px;
        height: 15px;
    }

    .language-dropdown-menu {
        min-width: 220px;
    }

        .language-dropdown-menu .dropdown-item {
            padding: 10px 14px;
            gap: 10px;
            font-size: 13px;
        }

            .language-dropdown-menu .dropdown-item .language-code {
                font-size: 12px;
                min-width: 26px;
            }

            .language-dropdown-menu .dropdown-item .language-flag-icon {
                width: 22px;
                height: 16px;
            }

            .language-dropdown-menu .dropdown-item .language-item-name {
                font-size: 13px;
            }
}

/* Sidebar Menu Animation Optimization */
#accordion-menu .submenu {
    will-change: height;
    transform: translateZ(0);
    backface-visibility: hidden;
}

#accordion-menu .dropdown-toggle {
    transition: color 0.15s ease-in-out;
}

#accordion-menu .dropdown.show > a {
    transition: all 0.15s ease-in-out;
}

/* ============================================
   TABLE AND MODAL RESPONSIVE STYLES
   ============================================ */

/* Table Text Wrapping and Overflow Handling */
.table {
    table-layout: auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

    .table td,
    .table th {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
        padding: 0.75rem;
        vertical-align: middle;
    }

/* Badge responsive sizing */
.badge {
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}

/* Font weight bold text wrapping */
.font-weight-bold {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Modal responsive text */
.modal-body,
.modal-header,
.modal-footer {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

    .modal-body p,
    .modal-body strong,
    .modal-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }

/* Dropdown menu responsive */
.dropdown-menu {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.dropdown-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    padding: 0.5rem 1rem;
}

/* Table responsive for small screens */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }

        .table td,
        .table th {
            padding: 0.5rem;
            font-size: 0.8rem;
        }

        /* Prevent table headers from breaking vertically on mobile */
        .table thead th {
            white-space: nowrap;
            min-width: 120px;
        }

    /* Ensure tables scroll horizontally instead of breaking layout */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .font-weight-bold {
        font-weight: 600;
    }

    /* Reduce icon size on mobile */
    .icon-copy {
        font-size: 0.9rem;
    }

    /* Utility: add vertical spacing above buttons on mobile to avoid sticking to previous element */
    .btn-mobile-spacing {
        margin-top: 0.5rem !important;
    }

    
    /* Utility: stack multiple action buttons vertically with spacing on mobile */
    .btn-group-mobile .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.35rem;
    }

    .btn-group-mobile .btn:last-child {
        margin-bottom: 0;
    }

    /* Modal adjustments for mobile */
/*     .modal-dialog {
        margin: 0.5rem; 
    } */

    .modal-body {
        padding: 1rem;
    }

        .modal-body p {
            font-size: 0.9rem;
            line-height: 1.4;
        }

    .modal-title {
        font-size: 1rem;
    }

    /* Dropdown menu mobile */
    .dropdown-menu {
        font-size: 0.85rem;
    }

    .dropdown-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .table {
        font-size: 0.75rem;
    }

        .table td,
        .table th {
            padding: 0.4rem;
            font-size: 0.7rem;
        }

    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .icon-copy {
        font-size: 0.8rem;
    }

    .modal-body p {
        font-size: 0.85rem;
    }

    .modal-title {
        font-size: 0.95rem;
    }

    .dropdown-item {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Ensure text doesn't overflow in narrow containers */
    .text-center {
        text-align: center;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Additional responsive text handling */
.table-responsive-text td {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure long text in cells doesn't overflow */
.table td strong {
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Exclude .name-column from generic span styling */
.table td span:not(.name-column) {
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Modal content responsive */
.modal-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-body strong {
    display: inline;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Ensure badges wrap properly */
.badge-info,
.badge-success,
.badge-warning,
.badge-dark,
.badge-secondary {
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Small text wrapping */
small {
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: inline-block;
    max-width: 100%;
}

/* ============================================
   CUSTOM CHECKBOX STYLES
   ============================================ */

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #b2d600 !important;
    border-color: #b2d600 !important;
}

.custom-control-input:checked ~ .custom-control-label::after {
    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='%23fff' d='M9.854 2.25L4.5 7.604 2.146 5.25l-1.5 1.5L4.5 10.604l6.354-6.354z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left !important;
    background-size: 70% 70% !important;
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(178, 214, 0, 0.25) !important;
}

.custom-control-label::before {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.25rem !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.custom-control-label::after {
    top: 0.125rem !important;
    left: -1.625rem !important;
    display: block !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    content: "" !important;
    background: no-repeat left !important;
}

/* Override any conflicting checkbox styles */
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
    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='%23fff' d='M9.854 2.25L4.5 7.604 2.146 5.25l-1.5 1.5L4.5 10.604l6.354-6.354z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left !important;
    background-size: 70% 70% !important;
}

/* ============================================
   ACCORDION / COLLAPSE STYLES
   ============================================ */

.accordion .card {
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}


.accordion .btn-link {
    text-decoration: none !important;
    color: #333 !important;
    font-weight: 600;
    padding: 0.75rem 1rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

    .accordion .btn-link:hover {
        color: #b2d600 !important;
        background-color: rgba(178, 214, 0, 0.05);
    }

    .accordion .btn-link:not(.collapsed) {
        color: #b2d600 !important;
        background-color: rgba(178, 214, 0, 0.08);
    }

    .accordion .btn-link i.dw-down-arrow {
        transition: transform 0.3s ease;
    }

    .accordion .btn-link:not(.collapsed) i.dw-down-arrow {
        transform: rotate(180deg);
    }

.collapse {
    transition: all 0.3s ease;
}

    .collapse.show {
        animation: slideDown 0.3s ease-out;
    }

/* ============================================
   NAME COLUMN TRUNCATION (25 characters)
   ============================================ */

/* Truncate Name column with ellipsis */
.name-column {
    max-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    vertical-align: middle;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* Ensure parent td doesn't interfere */
.table td .name-column {
    width: auto;
    max-width: 200px !important;
}

/* Override font-weight-bold for name column */
td.font-weight-bold .name-column {
    max-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Responsive adjustments for Name column */
@media (max-width: 1024px) {
    .name-column {
        max-width: 150px !important;
    }

    td.font-weight-bold .name-column {
        max-width: 150px !important;
    }
}

@media (max-width: 768px) {
    .name-column {
        max-width: 120px !important;
    }

    td.font-weight-bold .name-column {
        max-width: 120px !important;
    }
}

@media (max-width: 576px) {
    .name-column {
        max-width: 100px !important;
    }

    td.font-weight-bold .name-column {
        max-width: 100px !important;
    }
}
