/*
 * ═══════════════════════════════════════════════════════════════
 *  wis-ui.css  —  WIS globalni UI stilovi
 *
 *  Sadrži:
 *    1. Top header (hamburger, naslov, help/message dugmad)
 *    2. Footer (pager, length select, +New dugme, backdrop)
 *    3. Dialog paneli (help, message)
 *    4. pageListHeader (generalni filteri)
 *    5. pageListHeader2 (Orders filteri)
 *    6. Status lista (#status u sidebaru)
 *
 *  Učitava se u index.tpl.
 *  Ne sadrži plugin-specifične stilove (orders.css, dashboard.css...)
 * ═══════════════════════════════════════════════════════════════
 */

/* ══════════════════════════════════════════════════════════════
   TOP HEADER — .header.row.border-bottom
   ══════════════════════════════════════════════════════════════ */

.navbar-static-top-edit {
    margin-bottom: 0;
    border-bottom: none;
    background: linear-gradient(135deg, #f0f5ff 0%, #e4eeff 100%);
    border-bottom: 2px solid #c8d8ee;
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

/* Lijeva strana — hamburger + naslov */
.navbar-left-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* Hamburger dugme */
.minimalize-styl-2.btn-primary-edit {
    background: #1a7fd4;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 15px;
    line-height: 1;
    color: white;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.2);
    transition: background 0.15s;
    cursor: pointer;
}

.minimalize-styl-2.btn-primary-edit:hover {
    background: #1565c0;
}

/* Naslov stranice */
.wis-page-title {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    font-size: clamp(14px, calc(var(--fs, 13px) + 4px), 20px);
    font-weight: 600;
    color: #2c3e6b;
    line-height: 1.2;
}

.wis-page-title .text-muted {
    color: #5a7aaa !important;
}

.wis-page-title .fields-badge {
    font-size: 0.7em;
    color: #888;
    font-weight: 400;
}

/* Desna strana — Help / Message dugmad */
.navbar-top-links.navbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbar-top-links.navbar-right > li {
    display: inline-block;
}

/* ── Help / Message / Day Start dugmad ── */
.button-3 {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    font-size: calc(var(--fs, 13px) - 0.5px);
    border-radius: 15px;        /* pill oblik */
    border: 1.5px solid transparent;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
    letter-spacing: 0.2px;
}

.button-3:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.button-3:active {
    transform: translateY(0);
}

/* HELP — zelena */
.btn-help {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
    box-shadow: 0 1px 3px rgba(46, 125, 50, 0.15);
}

.btn-help:hover {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
    box-shadow: 0 3px 8px rgba(46, 125, 50, 0.35);
}

.btn-help .fa {
    font-size: 14px;
}

/* MESSAGE — plava */
.btn-message {
    background: #e3f0ff;
    color: #1565c0;
    border-color: #90caf9;
    box-shadow: 0 1px 3px rgba(21, 101, 192, 0.15);
}

.btn-message:hover {
    background: #1565c0;
    color: white;
    border-color: #1565c0;
    box-shadow: 0 3px 8px rgba(21, 101, 192, 0.35);
}

.btn-message .fa {
    font-size: 13px;
}

/* DAY START — narandžasta */
.btn-daystart {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffcc80;
    box-shadow: 0 1px 3px rgba(230, 81, 0, 0.15);
}

.btn-daystart:hover {
    background: #e65100;
    color: white;
    border-color: #e65100;
    box-shadow: 0 3px 8px rgba(230, 81, 0, 0.35);
}

.btn-daystart .fa {
    font-size: 14px;
}

/* ── jQuery UI Dialog stilizacija ── */

/* Zajednički stil za oba dialoga */
.dialog_help_style .ui-dialog-titlebar,
.dialog_message_style .ui-dialog-titlebar {
    border-radius: 8px 8px 0 0;
    border: none;
    padding: 10px 16px;
    font-size: calc(var(--fs, 13px) + 1px);
    font-weight: 700;
}

.dialog_help_style .ui-dialog-content,
.dialog_message_style .ui-dialog-content {
    padding: 14px 18px;
    font-size: inherit;
    line-height: 1.6;
    max-height: 65vh;
    overflow-y: auto;
}

.dialog_help_style .ui-dialog,
.dialog_message_style .ui-dialog {
    border-radius: 8px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}

.dialog_help_style .ui-dialog-titlebar-close,
.dialog_message_style .ui-dialog-titlebar-close {
    border-radius: 50%;
    width: 24px;
    height: 24px;
    top: 50%;
    transform: translateY(-50%);
    right: 12px;
    margin: 0;
    background: rgba(255,255,255,0.3);
    border: none;
    transition: background 0.15s;
}

.dialog_help_style .ui-dialog-titlebar-close:hover,
.dialog_message_style .ui-dialog-titlebar-close:hover {
    background: rgba(255,255,255,0.55);
}

/* HELP dialog — zeleni header */
.dialog_help_style .ui-dialog-titlebar {
    background: linear-gradient(135deg, #2e7d32, #388e3c);
    color: white;
}

.dialog_help_style .ui-dialog-titlebar .ui-icon-closethick {
    color: white;
}

/* MESSAGE dialog — plavi header */
.dialog_message_style .ui-dialog-titlebar {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: white;
}

/* MESSAGE — textarea i footer */
.dialog_message_style .textarea-dialog {
    width: 100%;
    min-height: 90px;
    border: 1px solid #b0cce8;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.dialog_message_style .textarea-dialog:focus {
    border-color: #1565c0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.12);
}

.dialog_message_style .previous-messages {
    margin-top: 10px;
    border-top: 1px solid #e0e8f5;
    padding-top: 8px;
    font-size: calc(var(--fs, 13px) - 0.5px);
}

/* Save dugme u message dialogu */
.dialog_message_style .ui-dialog-buttonpane {
    border-top: 1px solid #e0e8f5;
    padding: 8px 14px;
    background: #f8fbff;
}

.dialog_message_style .saved-button,
.dialog_message_style .ui-dialog-buttonset button {
    background: #1565c0;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 20px;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.dialog_message_style .saved-button:hover,
.dialog_message_style .ui-dialog-buttonset button:hover {
    background: #0d47a1;
}

/* Profile image u sidebar headeru */
.nav-header-top-edit .img-circle {
    height: 32px;
    width: 32px;
    object-fit: cover;
    padding: 0;
    margin: 0;
    border: 2px solid rgba(255,255,255,0.3);
}

.nav-header-top-edit .font-bold {
    margin: 0 0 0 8px;
    font-weight: 700;
}

/* Logout link u sidebar headeru */
.sidebar-logout {
    margin-top: 10px;
    text-align: center;
    text-decoration: underline;
}

/* ── Dialog paneli (help, message) ── */
.dialog-help,
.dialog-message {
    display: none;
    position: fixed;
    top: 55px;
    right: 10px;
    z-index: 1050;
    background: white;
    border: 1px solid #c8d8ee;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 10px;
    min-width: 280px;
    max-width: 400px;
}

.textarea-dialog {
    width: 100%;
    min-height: 80px;
    border: 1px solid #c8d8ee;
    border-radius: 4px;
    padding: 6px;
    font-size: inherit;
    resize: vertical;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER — .footer.row.footer-edit
   ══════════════════════════════════════════════════════════════ */

.footer-edit {
    background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fc 100%);
    border-top: 2px solid #c8d8ee;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
}

/* ── Filter toggle dugme u footeru ── */
#footer-filters {
    display: inline-flex;
    align-items: center;
}

#filter-show.button-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 700;
    font-size: calc(var(--fs, 13px) - 0.5px);
    color: #1a7fd4;
    padding: 4px 8px;
    border-radius: 5px;
    background: white;
    border: 1px solid #b0cce8;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    user-select: none;
}

#filter-show.button-toggle:hover {
    background: #1a7fd4;
    color: white;
}

#filter-show.button-toggle:hover .fa-bars-edit {
    color: white;
}

.fa-bars-edit {
    font-size: 16px;
    color: #1a7fd4;
    transition: color 0.15s;
}

/* ── Filter wrapper (pager + length + +New) ── */
.filter-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

/* Info show (count) */
#infoShow {
    font-size: calc(var(--fs, 13px) - 1px);
    color: #5a7aaa;
    white-space: nowrap;
    padding: 0 4px;
}

/* ── Pager (#pageSelect) ── */
#pageSelect {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    float: none !important;
    padding: 0 !important;
}

/* Pager dugmad — prev/next i brojevi stranica */
#pageSelect .btn,
#pageSelect button,
#pageSelect a.btn {
    height: 28px;
    min-width: 28px;
    padding: 0 7px;
    font-size: calc(var(--fs, 13px) - 1px);
    border-radius: 5px !important;
    border: 1px solid #b0cce8;
    background: white;
    color: #1a7fd4;
    font-weight: 600;
    line-height: 26px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#pageSelect .btn:hover,
#pageSelect button:hover,
#pageSelect a.btn:hover {
    background: #1a7fd4;
    color: white;
    border-color: #1a7fd4;
}

/* Aktivna/trenutna stranica */
#pageSelect .btn.active,
#pageSelect .btn-primary,
#pageSelect a.btn-primary {
    background: #1565c0;
    color: white;
    border-color: #1565c0;
}

/* Select za broj stranice (ako se koristi) */
#pageSelect select {
    height: 28px;
    padding: 2px 4px;
    font-size: calc(var(--fs, 13px) - 1px);
    border: 1px solid #b0cce8;
    border-radius: 5px !important;
    color: #1a7fd4;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
    cursor: pointer;
}

/* ── Length select (per page) ── */
.col-xs-edit,
.footer-edit [class*="col-"]:has(#length) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 !important;
    flex: 0 0 auto;
    width: auto !important;
}

#length.control-edit {
    height: 28px;
    padding: 2px 4px;
    width: auto !important;
    min-width: 60px;
    font-size: calc(var(--fs, 13px) - 1px);
    border: 1px solid #b0cce8;
    border-radius: 5px !important;
    color: #1a7fd4;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
    cursor: pointer;
}

/* Eye icon pored length selecta */
.footer-edit .edit-fa {
    color: #1a7fd4;
    font-size: 13px;
    flex-shrink: 0;
}

/* ── +New dugme ── */
.btn-xs-edit {
    height: 28px;
    width: 28px;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: white !important;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(46, 125, 50, 0.35);
    transition: background 0.15s, transform 0.1s;
}

.btn-xs-edit:hover {
    background: #1b5e20 !important;
    border-color: #1b5e20 !important;
    transform: scale(1.1);
}

/* ── Backdrop / Spinner (loading) ── */
.backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.65);
    z-index: 9000;
}

.spiner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0e8f5;
    border-top-color: #1a7fd4;
    border-radius: 50%;
    animation: wis-spin 0.75s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -22px 0 0 -22px;
}

@keyframes wis-spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════
   STATUS LISTA (A/T/D/P u sidebaru)
   ══════════════════════════════════════════════════════════════ */

#status {
    list-style-type: none;
    padding: 6px 14px;
    margin: 0;
    font-size: calc(var(--fs, 13px) - 2px);
    opacity: 0.55;
    border-top: 1px solid rgba(255,255,255,0.08);
}

#status li {
    padding: 1px 0;
}

/* ══════════════════════════════════════════════════════════════
   PAGE LIST HEADER — generalni filteri (pageListHeader.tpl)
   ══════════════════════════════════════════════════════════════ */

/* Wrapper toggle dugmeta */
#pageListHeader-filters {
    display: inline-flex;
    align-items: center;
    background: rgba(71, 157, 233, 0.12);
    border-radius: 6px;
    padding: 2px 8px 2px 2px;
    box-shadow: 1px 1px 4px rgba(59, 117, 185, 0.3);
    margin-bottom: 4px;
}

/* Toggle show/hide dugme */
#show-hide.button-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: calc(var(--fs, 13px) - 1px);
    color: #1a7fd4;
    text-shadow: 0 0 1px rgba(5, 132, 241, 0.3);
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.15s;
    white-space: nowrap;
}

#show-hide.button-toggle:hover {
    color: #0b70c9;
}

/* Filter row — flex wrap */
.filter.filter-one-edit {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px;
    padding: 6px 4px 4px;
}

.filter.filter-one-edit > [class*="col-"] {
    float: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    width: auto !important;
    flex: 0 0 auto;
}

.filter.filter-one-edit .edit-fa {
    color: #1a7fd4;
    font-size: 14px;
    flex-shrink: 0;
}

.filter.filter-one-edit .form-group.group-edit {
    display: inline-block;
    margin-bottom: 0;
    width: auto;
}

.filter.filter-one-edit .form-control.control-edit,
.filter.filter-one-edit .datepicker-edit {
    height: 28px;
    padding: 2px 6px;
    font-size: inherit;
    border-radius: 5px !important;
    border: 1px solid #b0cce8;
    box-shadow: 1px 1px 2px rgba(63, 80, 161, 0.2);
    color: #1a7fd4;
    min-width: 110px;
    max-width: 160px;
}

.filter.filter-one-edit .datepicker-edit {
    min-width: 95px;
    max-width: 120px;
}

/* ══════════════════════════════════════════════════════════════
   PAGE LIST HEADER 2 — Orders filteri (pageListHeader2.tpl)
   ══════════════════════════════════════════════════════════════ */

/* Toggle dugme wrapper */
#wrapp-button {
    display: inline-flex;
    align-items: center;
    background: rgba(71, 157, 233, 0.12);
    border-radius: 6px;
    padding: 2px 8px 2px 2px;
    box-shadow: 1px 1px 4px rgba(59, 117, 185, 0.3);
    margin-bottom: 6px;
    width: fit-content;
}

#filterToggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: calc(var(--fs, 13px) - 1px);
    color: #1a7fd4;
    text-shadow: 0 0 1px rgba(5, 132, 241, 0.3);
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.15s;
    white-space: nowrap;
}

#filterToggle:hover {
    color: #0b70c9;
}

/* Top row — sort/report/filter selekti */
.row-second-edit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 4px 0 6px;
}

.row-second-edit > div {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.b-asd {
    color: #1a7fd4;
    font-size: calc(var(--fs, 13px) - 0.5px);
    font-weight: 700;
    white-space: nowrap;
}

.select-top-edit {
    color: #1a7fd4 !important;
    padding: 2px 4px;
    height: 28px;
    border-radius: 5px !important;
    border: 1px solid #b0cce8;
    box-shadow: 1px 1px 2px rgba(63, 80, 161, 0.2);
    font-size: inherit !important;
    min-width: 90px;
    max-width: 150px;
    background: white;
}

/* 6-panel filter grid */
#filter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 4px 0;
    margin-left: 0;
    margin-right: 0;
}

#filter-grid::before,
#filter-grid::after {
    display: none;
    content: none;
}

#filter-grid > div {
    float: none;
    padding: 6px 8px;
    background: #f8fbff;
    border: 1px solid #d0e4f5;
    border-radius: 6px;
    box-sizing: border-box;
    min-width: 0;
}

/* Section badge header */
.badge-edit {
    display: block;
    color: #1565c0;
    background: #e3f0ff;
    font-size: calc(var(--fs, 13px) - 2px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 5px;
    border-left: 3px solid #1a7fd4;
}

/* Inputs unutar panel-a */
.row-filter-edit .input-one,
.row-filter-edit .form-control,
#filter-grid .form-control {
    width: 100%;
    height: 26px;
    padding: 2px 6px;
    font-size: inherit;
    border-radius: 4px !important;
    border: 1px solid #b0cce8;
    box-shadow: 1px 1px 2px rgba(63, 80, 161, 0.1);
    color: #333;
    margin-bottom: 3px;
    box-sizing: border-box;
    background: white;
}

.row-filter-edit .select-top-edit.below-select,
#filter-grid .select-top-edit.below-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 26px;
    margin-bottom: 3px;
}

/* Datepicker par — side by side */
.datepicker-pair {
    display: flex;
    gap: 3px;
    margin-top: 3px;
}

.datepicker-pair input {
    flex: 1;
    min-width: 0;
    height: 26px;
    padding: 2px 4px;
    font-size: calc(var(--fs, 13px) - 1px);
    border-radius: 4px !important;
    border: 1px solid #b0cce8;
    box-shadow: 1px 1px 2px rgba(63, 80, 161, 0.2);
    color: #1a7fd4;
    box-sizing: border-box;
    background: white;
}

/* Checkboxes */
.row-filter-edit .check-pair,
#filter-grid .check-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 3px;
}

.check-pair label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: calc(var(--fs, 13px) - 1px);
    font-weight: normal;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
}

.check-pair input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* pageListHeader2 — filter grid breakpointi */
@media screen and (max-width: 1399px) {
    #filter-grid { grid-template-columns: repeat(3, 1fr); }
    .row-second-edit { flex-wrap: wrap; }
}

@media screen and (max-width: 990px) {
    #filter-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 767px) {
    #filter-grid { grid-template-columns: 1fr; }
    .row-second-edit { flex-direction: column; align-items: flex-start; }
    .select-top-edit { max-width: 100%; min-width: 120px; }
    .datepicker-pair input { font-size: inherit; }

    /* Footer — stack na mobilnom */
    .filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    #pageSelect {
        flex-wrap: wrap;
    }
}

/* Toggle show/hide za pageListHeader2 */
@media screen and (min-width: 1356px) {
    .filter.addedit { display: block !important; }
    #wrapp-button { display: none !important; }
}

@media screen and (max-width: 1355px) {
    .filter.addedit { display: none; }
    #wrapp-button { display: inline-flex; }
}

/* pageListHeader — filter na tabletu */
@media screen and (max-width: 1200px) {
    .filter.filter-one-edit { gap: 5px; }
    .filter.filter-one-edit .form-control.control-edit {
        min-width: 90px;
        max-width: 130px;
    }
}

/* pageListHeader — filter na mobilnom */
@media screen and (max-width: 767px) {
    .filter.filter-one-edit {
        flex-direction: column;
        align-items: flex-start;
    }
    .filter.filter-one-edit > [class*="col-"] { width: 100% !important; }
    .filter.filter-one-edit .form-control.control-edit,
    .filter.filter-one-edit .datepicker-edit {
        min-width: 140px;
        max-width: 100%;
        width: 100%;
    }
}
