/* ========================================
   MAIN CSS - Custom Utilities & Components
   Refactored to work with pharceco-theme.css
   ======================================== */

/* ========================================
   LUCIDE ICONS
   ======================================== */

[data-lucide] {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    stroke-width: 2;
}

/* Icon in header nav */
.navbar-nav [data-lucide] {
    width: 18px;
    height: 18px;
}

/* Icon in sidebar */
.sidebar-menu [data-lucide] {
    width: 18px;
    height: 18px;
    margin-right: 5px;
}

/* Spinning animation for loader icons */
.lucide-spin {
    animation: lucide-spinning 1s linear infinite;
}

@keyframes lucide-spinning {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Icon colors - match FA text color classes */
[data-lucide].text-green { stroke: #00a65a; }
[data-lucide].text-red { stroke: #dd4b39; }
[data-lucide].text-yellow { stroke: #f39c12; }
[data-lucide].text-gray { stroke: #d2d6de; }
[data-lucide].text-navy { stroke: #001f3f; }
[data-lucide].text-danger { stroke: #dd4b39; }
[data-lucide].text-success { stroke: #00a65a; }

/* ========================================
   BUTTON UTILITIES
   ======================================== */

.btn-loading {
    position: relative;
    padding-right: 32px;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url(/center/static/main/img/loading.gif);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.btn-xs.btn-loading::after {
    top: 3px;
    right: 3px;
    width: 15px;
    height: 15px;
}

/* ========================================
   TEXT & SELECTION UTILITIES
   ======================================== */

.usn {
    user-select: none;
}

.cup {
    cursor: pointer;
}

.h-underline:hover {
    text-decoration: underline;
}

.tdu {
    text-decoration: underline;
}

.text-hint {
    color: var(--text-secondary, #7F8C8D);
    font-weight: normal;
}

/* ========================================
   DISPLAY UTILITIES
   ======================================== */

.dib {
    display: inline-block;
}

.db {
    display: block;
}

.hidden {
    display: none !important;
}

.hidden-next + * {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ========================================
   FORM UTILITIES
   ======================================== */

.form-group .hint {
    color: var(--text-secondary, #7F8C8D);
    font-weight: normal;
}

.form-group .hint::before {
    content: " ("
}

.form-group .hint::after {
    content: ")"
}

.form-group.required label::after {
    content: " *";
    color: var(--danger-color, #E74C3C);
}

.dropdown-menu-left {
    left: auto;
    right: 0;
}

.form-chevron-down,
select.form-control {
    -webkit-appearance: none;
    background-image: url(/center/static/main/img/chevron_down.svg);
    background-repeat: no-repeat;
    background-position: right 10px bottom 50%;
    padding-right: 30px !important;
}

.dataTables_length select.form-control {
    padding: 0 7px;
}

/* ========================================
   TABLE UTILITIES
   ======================================== */

.table {
    width: 100% !important;
}

.table .dtr-details li {
    max-width: 100%;
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
}

.table .dtr-details {
    width: 100%;
}

.table .dtr-data {
    max-width: 100%;
    margin-left: 15px;
}

div.dataTables_filter label {
    width: 100%;
}

div.dataTables_filter input {
    width: calc(100% - 6px) !important;
}

/* ========================================
   MODAL UTILITIES
   ======================================== */

/* Legacy modal sizes - maintained for backward compatibility */
.modal-xl {
    width: 1139px;
}

.modal-xxl {
    width: 1266px;
}

/* Right-side modal drawer */
.modal-right {
    position: fixed;
    top: -30px;
    right: 0;
}

.modal-right > .modal-content {
    height: 100vh;
    overflow-y: auto;
}

.modal.fade .modal-dialog.modal-right {
    transform: translate(25%, 0);
}

.modal.in .modal-dialog.modal-right {
    transform: translate(0, 0);
}

/* Modal size shortcuts for forms */
.modal-form-lg .modal-dialog {
    max-width: 900px;
}

.modal-form-xl .modal-dialog {
    max-width: 1200px;
}

/* Form utility classes for modal body layouts */
.modal-body .form-columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-body .form-columns-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.modal-body .form-columns-2 .form-group,
.modal-body .form-columns-3 .form-group {
    margin-bottom: 0;
}

/* ========================================
   BUTTON & INTERACTION UTILITIES
   ======================================== */

.btn-table {
    cursor: pointer;
    padding: 8px;
    margin: -5px;
}

[click-emit] {
    cursor: pointer;
}

/* ========================================
   TEXT OVERFLOW UTILITIES
   ======================================== */

.wsn {
    vertical-align: inherit;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ell200 {
    vertical-align: inherit;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ell250 {
    vertical-align: inherit;
    display: inline-block;
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ell300 {
    vertical-align: inherit;
    display: inline-block;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   CHOICE WRAPPER UTILITIES
   ======================================== */

.wrapper-choice {
    display: flex;
    flex-wrap: wrap;
}

.wrapper-choice > div {
    border: 1px solid var(--primary-color, #2D9973);
    border-radius: 7px;
    margin: 1px 2px;
    cursor: pointer;
    color: var(--primary-color, #2D9973);
    padding: 2px 6px;
    user-select: none;
    background: #fff;
    transition: all 0.3s ease-in-out;
}

.wrapper-choice > div.active {
    background: var(--primary-color, #2D9973);
    color: #fff;
}

/* ========================================
   CHECKBOX UTILITIES
   ======================================== */

.form-checkbox input {
    margin-right: 5px;
}

.form-checkbox {
    user-select: none;
    display: flex;
    cursor: pointer;
}

/* ========================================
   SPACING UTILITIES - Margin Top
   ======================================== */

.mt5 {
    margin-top: 5px;
}

.mt10 {
    margin-top: 10px;
}

.mt20 {
    margin-top: 20px;
}

.mt30 {
    margin-top: 30px;
}

.mt40 {
    margin-top: 40px;
}

.mt50 {
    margin-top: 50px;
}

.mt60 {
    margin-top: 60px;
}

/* ========================================
   SPACING UTILITIES - Margin Bottom
   ======================================== */

.mb5 {
    margin-bottom: 5px;
}

.mb10 {
    margin-bottom: 10px;
}

.mb20 {
    margin-bottom: 20px;
}

.mb30 {
    margin-bottom: 30px;
}

.mb40 {
    margin-bottom: 40px;
}

.mb50 {
    margin-bottom: 50px;
}

.mb60 {
    margin-bottom: 60px;
}

/* ========================================
   SPACING UTILITIES - Margin Left
   ======================================== */

.ml3 {
    margin-left: 3px;
}

.ml5 {
    margin-left: 5px;
}

.ml10 {
    margin-left: 10px;
}

.ml15 {
    margin-left: 15px;
}

.ml20 {
    margin-left: 20px;
}

/* ========================================
   SPACING UTILITIES - Margin Right
   ======================================== */

.mr3 {
    margin-right: 3px;
}

.mr5 {
    margin-right: 5px;
}

.mr10 {
    margin-right: 10px;
}

.mr15 {
    margin-right: 15px;
}

.mr20 {
    margin-right: 20px;
}

/* ========================================
   SPACING UTILITIES - Padding
   ======================================== */

.p0 {
    padding: 0 !important;
}

.p5 {
    padding: 5px !important;
}

.p10 {
    padding: 10px !important;
}

.p15 {
    padding: 15px !important;
}

.p20 {
    padding: 20px !important;
}

/* ========================================
   WRAPPER PLACE UTILITIES
   ======================================== */

.wrapper-place-i {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 7px 10px;
}

.wrapper-place-i:hover {
    color: #fff;
    background-color: var(--primary-color, #2D9973);
}

/* ========================================
   WEIGHT TAG UTILITIES
   ======================================== */

.wt-box {
    display: flex;
    flex-wrap: wrap;
}

.wt-item {
    padding: 3px 7px;
    margin: 2px;
    border-radius: 21px;
    border: 1px solid var(--primary-color, #2D9973);
    cursor: pointer;
    user-select: none;
    color: var(--primary-color, #2D9973);
    background: #fff;
    transition: all 0.3s ease-in-out;
}

.wt-active {
    background: var(--primary-color, #2D9973);
    color: #fff;
}

/* ========================================
   PROGRESS INDICATOR (PROG)
   ======================================== */

.prog {
    display: flex !important;
    align-items: center;
    height: 50px;
    padding-right: 100px;
    color: #fff;
    transition: opacity .3s ease-in-out;
}

.prog-float {
    position: fixed !important;
    background: rgba(0, 0, 0, 0.77);
    top: 25px;
    padding: 10px;
    right: 50px;
    z-index: 10510000;
    border-radius: 4px;
}

.prog-fade {
    pointer-events: none;
    opacity: 0;
}

.prog-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: prog-spinning .6s linear 0s infinite;
    margin-left: 10px;
}

.prog-icon {
    margin-left: 10px;
    font-size: 20px;
}

.prog-icon:not(.hidden) + .prog-spinner {
    display: none;
}

@keyframes prog-spinning {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   FORM SUGGESTION DROPDOWN
   ======================================== */

.form-group {
    position: relative;
}

.form-suggest {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #fff;
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
    width: 100%;
    z-index: 10;
    border-radius: var(--border-radius-md, 6px);
}

.form-suggest > * {
    padding: 7px 15px;
    cursor: pointer;
    border-top: 1px solid #eee;
}

.form-suggest > *:hover {
    background: rgba(0, 0, 0, 0.03);
}

.form-suggest > *:first {
    border-top: none;
}

.form-suggest .label {
    margin-right: 5px;
}

/* ========================================
   SELECT2 UTILITIES
   ======================================== */

.select2 {
    width: 100% !important;
}

/* ========================================
   MULTIPLE SELECT UTILITIES
   ======================================== */

.ms-parent {
    width: 100% !important;
}

.ms-choice {
    height: 34px !important;
    line-height: 34px !important;
    border-color: var(--border-color, #E8ECF0) !important;
    border-radius: 0 !important; 
}

.ms-drop {
    box-shadow: none !important;
    border-color: var(--border-color, #E8ECF0) !important;
    border-radius: 0 !important; 
}

.ms-choice > div {
    top: 10px !important;
    background: url(/center/static/main/img/chevron_down.svg) left top no-repeat !important;
}

.ms-drop input {
    position: relative;
    margin: 0;
    margin-right: 6px;
    vertical-align: baseline !important;
}

.ms-drop input::before {
    content: "";
    background: #fff;
    position: absolute;
    width: 15px;
    height: 15px;
    border: 1px solid #ccc;
    border-radius: 2px;
    cursor: pointer;
}

.ms-drop input:checked::before {
    width: 18px;
    height: 18px;
    margin-top: -1px;
    margin-left: -1px;
    border: none;
    background: url(/center/static/main/img/tick.png) no-repeat center;
}

/* ========================================
   TINYEDITOR UTILITIES
   ======================================== */

.mce-tinymce {
    box-shadow: none !important;
}

.mce-branding {
    display: none !important;
}

.mce-fullscreen {
    z-index: 1000 !important;
}

/* ========================================
   SWEETALERT UTILITIES
   ======================================== */

.swal-button--loading {
    color: transparent !important;
}

/* ========================================
   NOTIFICATION UTILITIES
   ======================================== */

.notification {
    max-height: calc(100vh - 100px) !important;
}

.notification > li {
    display: flex;
    align-items: center;
}

.notification > li > a {
    flex: auto;
}

.notification > li > span {
    padding: 13px;
    border-bottom: 1px solid #f4f4f4;
    margin-left: 0 !important;
    cursor: pointer;
}

.notification > li > span:hover {
    background: rgba(0, 0, 0, 0.2);
}

.notifications-menu > .dropdown-menu {
    width: 550px !important;
}

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background: rgba(0, 0, 0, 0.329);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease-in-out;
}

.notifications-menu.open > .notification-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   HEADER UTILITIES
   ======================================== */

.header-quote {
    float: right;
    color: var(--text-secondary, #7F8C8D);
    margin: 25px 30px 0 0;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   STORE EDIT MODAL UTILITIES
   ======================================== */

#store_edit_modal_input {
    resize: vertical;
    height: 300px;
}

/* ========================================
   BANNER BOX UTILITIES
   ======================================== */

.banner-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 133px;
    background: var(--background-color, #F4F6F8);
    font-size: 14px;
    overflow: hidden;
}

.banner-box .cover-upload-btn {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
}

.cover-upload-btn {
    position: absolute;
    top: 9px;
    right: 16px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius-md, 6px);
    color: rgb(255, 255, 255);
    font-size: 14px;
    transition: all 0.3s ease-in-out;
}

.cover-upload-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ========================================
   NUMBER INPUT UTILITIES
   ======================================== */

input[type=number].form-control {
    padding: 0px !important;
    text-indent: 12px;
}

/* ========================================
   ACTIVITY CENTER UTILITIES
   ======================================== */

.activity-center-list > div {
    padding: 6px 0;
    border-bottom: 1px solid #e4e4e4;
}

.activity-center-list > div:hover {
    background: rgba(206, 206, 206, 0.21);
}

.activity-center-list > div:last-child {
    border-bottom: none;
}

.activity-center-created {
    color: #959595;
    float: right;
}

/* ========================================
   HEATMAP CANVAS UTILITIES
   ======================================== */

.heatmap-canvas {
    z-index: 9999;
    pointer-events: none;
}

/* ========================================
   IMAGE UTILITIES
   ======================================== */

.img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .modal-xl {
        width: auto;
    }

    .modal-xxl {
        width: auto;
    }

    .ell200,
    .ell250,
    .ell300 {
        max-width: 100%;
    }

    /* Login page responsive */
    .login-page .login-box {
        width: 95%;
        max-width: 400px;
    }

    .login-box-body {
        padding: 24px;
    }

    .login-box-body .login-box-msg {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .login-page .login-logo {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .login-page .login-box {
        width: 98%;
    }

    .login-box-body {
        padding: 20px;
    }

    .login-page .login-logo {
        gap: 8px;
    }

    .login-page .login-logo img {
        height: 36px;
    }

    .login-page .login-logo span:first-of-type {
        font-size: 18px !important;
    }

    .login-page .login-logo span:last-of-type {
        font-size: 10px !important;
    }

    .login-box-body .form-group input.form-control {
        padding: 10px 10px 10px 36px;
        font-size: 13px;
        height: 40px;
    }

    .login-box-body .row {
        flex-direction: column;
    }

    .login-box-body .col-xs-6 {
        width: 100%;
        margin-bottom: 8px;
    }

    .login-box-body .btn-primary {
        height: 40px;
        font-size: 13px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
}
