/* =========================================================
   TSA CARGO ADS
   Clean / Modern / Responsive
   Standardized Modals
   ========================================================= */

:root {
    --cargo-primary: #07111f;
    --cargo-primary-soft: #122235;

    /* Jedinstvena akcijska boja za dugmad i modal headere */
    --cargo-action: #4f7fa5;
    --cargo-action-hover: #416b8c;

    --cargo-accent: #66a5ad;
    --cargo-accent-hover: #4f858d;

    --cargo-bg: #f5f7fa;
    --cargo-card: #ffffff;

    --cargo-border: #d8e0e8;
    --cargo-border-light: #e7edf3;

    --cargo-text: #263548;
    --cargo-muted: #718096;

    --cargo-blue: #2563eb;
    --cargo-blue-bg: #eff6ff;

    --cargo-green: #15803d;
    --cargo-green-bg: #ecfdf3;

    --cargo-yellow: #a16207;
    --cargo-yellow-bg: #fff8db;

    --cargo-red: #b91c1c;
    --cargo-red-bg: #fef2f2;

    --cargo-radius: 10px;
    --cargo-radius-sm: 7px;

    --cargo-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 8px 24px rgba(15, 23, 42, 0.055);

    --cargo-shadow-lg:
        0 20px 60px rgba(15, 23, 42, 0.18);

    --cargo-transition: 0.2s ease;
}


/* =========================================================
   GLOBAL
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cargo-bg);
    color: var(--cargo-text);
    font-family: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.main-content {
    width: 100%;
}

.cargo-layout {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    display: block;
}

.cargo-card {
    width: 100%;
    padding: 20px;
    background: var(--cargo-card);
    border: 1px solid var(--cargo-border-light);
    border-radius: var(--cargo-radius);
    box-shadow: var(--cargo-shadow);
}


/* =========================================================
   ADS HEADER
   ========================================================= */

.cargo-card > h2 {
    min-height: 42px;
    margin: 0 0 16px;
    padding: 0 0 14px;

    color: var(--cargo-primary);
    border-bottom: 1px solid var(--cargo-border-light);

    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.25;

    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cargo-card > h2 > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.cargo-card > h2 > span i {
    color: var(--cargo-accent);
    font-size: 0.95rem;
}


/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.ads-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}


/* =========================================================
   PRO MINI BUTTON
   ========================================================= */

.pro-promo-mini {
    height: 36px;
    min-height: 36px;

    padding: 0 12px;

    color: #fff !important;
    background: linear-gradient(
        135deg,
        #1b2737,
        #0e1725
    );

    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--cargo-radius-sm);

    text-decoration: none !important;

    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    white-space: nowrap;

    box-shadow: 0 3px 8px rgba(15,23,42,0.10);

    transition:
        background var(--cargo-transition),
        transform var(--cargo-transition),
        box-shadow var(--cargo-transition);
}

.pro-promo-mini:hover {
    color: #fff !important;
    background: linear-gradient(
        135deg,
        #26384d,
        #152338
    );

    transform: translateY(-1px);

    box-shadow: 0 6px 14px rgba(15,23,42,0.14);
}

.pro-promo-mini:active {
    transform: translateY(0);
}

.pro-promo-mini .fa-crown {
    color: #facc15;
}

.pro-promo-mini .fa-arrow-right {
    font-size: 0.68rem;
    opacity: 0.85;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn-publish-trigger,
.btn-search-trigger {
    min-height: 36px;
    padding: 0 12px;

    color: #fff;
    background: var(--cargo-action);

    border: 1px solid var(--cargo-action);
    border-radius: var(--cargo-radius-sm);

    font-size: 0.76rem;
    font-weight: 700;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    transition:
        background var(--cargo-transition),
        border-color var(--cargo-transition),
        transform var(--cargo-transition),
        box-shadow var(--cargo-transition);
}

.btn-publish-trigger:hover,
.btn-search-trigger:hover {
    color: #fff;

    background: var(--cargo-action-hover);
    border-color: var(--cargo-action-hover);

    box-shadow: 0 5px 12px rgba(63,105,138,0.20);
}

.btn-publish-trigger:active,
.btn-search-trigger:active {
    transform: translateY(1px);
}


/* =========================================================
   RESET
   ========================================================= */

.btn-reset-filters {
    min-height: 36px;
    padding: 0 11px !important;

    color: var(--cargo-text) !important;
    background: #f1f5f9 !important;

    border: 1px solid var(--cargo-border) !important;
    border-radius: var(--cargo-radius-sm);

    text-decoration: none;

    font-size: 0.75rem;
    font-weight: 650;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    transition:
        background var(--cargo-transition),
        border-color var(--cargo-transition),
        color var(--cargo-transition);
}

.btn-reset-filters:hover {
    color: var(--cargo-primary) !important;
    background: #e8edf3 !important;
    border-color: #c5d0dc !important;
}


/* =========================================================
   SECONDARY
   ========================================================= */

.btn-secondary {
    min-height: 38px;
    padding: 0 14px;

    color: var(--cargo-text);
    background: #e8edf3;

    border: 0;
    border-radius: var(--cargo-radius-sm);

    font-size: 0.8rem;
    font-weight: 650;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    transition:
        background var(--cargo-transition),
        transform var(--cargo-transition);
}

.btn-secondary:hover {
    background: #dce4ec;
}

.btn-secondary:active {
    transform: translateY(1px);
}


/* =========================================================
   PRIMARY SUBMIT
   ========================================================= */

.btn-submit {
    width: 100%;
    min-height: 42px;
    margin: 0;

    padding: 0 16px;

    color: #fff;
    background: var(--cargo-action);

    border: 0;
    border-radius: var(--cargo-radius-sm);

    font-size: 0.84rem;
    font-weight: 700;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    box-shadow: 0 4px 10px rgba(63,105,138,0.18);

    transition:
        background var(--cargo-transition),
        transform var(--cargo-transition),
        box-shadow var(--cargo-transition);
}

.btn-submit:hover {
    color: #fff;

    background: var(--cargo-action-hover);

    box-shadow: 0 6px 15px rgba(63,105,138,0.24);
}

.btn-submit:active {
    transform: translateY(1px);
}


/* =========================================================
   TABLE
   ========================================================= */

.table-container {
    width: 100%;
    max-height: 680px;

    overflow-x: auto;
    overflow-y: auto;

    border: 1px solid var(--cargo-border-light);
    border-radius: var(--cargo-radius-sm);

    background: #fff;

    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

table {
    width: 100%;
    min-width: 900px;

    border-collapse: separate;
    border-spacing: 0;

    text-align: left;

    font-size: 0.82rem;
}


/* =========================================================
   TABLE HEADER
   ========================================================= */

th {
    position: sticky;
    top: 0;
    z-index: 20;

    padding: 12px 12px;

    color: #334155;
    background: #f3f6f9;

    border-bottom: 1px solid var(--cargo-border);

    font-size: 0.73rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.025em;

    white-space: nowrap;

    cursor: pointer;

    transition: background var(--cargo-transition);
}

th:first-child {
    border-top-left-radius: 6px;
}

th:last-child {
    border-top-right-radius: 6px;
}

th:hover {
    background: #e9eef4;
    color: var(--cargo-primary);
}

th .fa-sort {
    margin-left: 5px;
    color: #94a3b8;
    font-size: 0.68rem;
}


/* =========================================================
   TABLE CELLS
   ========================================================= */

td {
    padding: 13px 12px;

    color: var(--cargo-text);
    background: #fff;

    border-bottom: 1px solid var(--cargo-border-light);

    vertical-align: middle;
}

tbody tr {
    transition: background var(--cargo-transition);
}

tbody tr:hover td {
    background: #f9fbfd;
}

tbody tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   AD TYPE BADGES
   ========================================================= */

.badge {
    min-width: 72px;

    padding: 5px 9px;

    border-radius: 5px;

    font-size: 0.67rem;
    font-weight: 750;
    line-height: 1.2;

    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.025em;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        transform var(--cargo-transition),
        box-shadow var(--cargo-transition);
}

.open-load-modal:hover .badge {
    transform: translateY(-1px);
}


/*
   UTOVAR = BLUE
*/

.badge-utovar {
    color: #1d4ed8;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
}


/*
   PREVOZ = GREEN
*/

.badge-prevoz {
    color: #15803d;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}


/* =========================================================
   ROUTE
   ========================================================= */

.route-container {
    min-width: 155px;

    display: flex;
    flex-direction: column;
    gap: 3px;

    font-size: 0.82rem;
}

.route-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;

    line-height: 1.35;
}

.route-row strong {
    color: var(--cargo-primary);
    font-size: 0.83rem;
    font-weight: 700;
}

.route-row::before {
    display: none;
}

.route-arrow {
    padding: 1px 0 1px 2px;

    color: #94a3b8;

    line-height: 1;
}

.route-arrow i {
    color: #94a3b8 !important;
    font-size: 0.6rem !important;
}

.country-name {
    color: var(--cargo-muted);
    font-size: 0.72rem;
}

.uniform-date-text {
    display: inline-block;

    color: #475569;

    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.55;

    white-space: nowrap;
}


/* =========================================================
   VEHICLE / GOODS
   ========================================================= */

td .vehicle-name {
    color: var(--cargo-primary);
    font-size: 0.83rem;
    font-weight: 700;
}

td .goods-name {
    color: var(--cargo-muted);
    font-size: 0.76rem;
}


/*
   HTML currently uses inline styles for these elements.
   !important ensures consistent appearance without
   requiring HTML changes.
*/

td div[style*="font-size: 0.85rem"] {
    margin-bottom: 3px !important;

    color: var(--cargo-primary) !important;

    font-size: 0.83rem !important;
    font-weight: 700 !important;
    line-height: 1.3;
}

td div[style*="font-size: 0.8rem"] {
    color: var(--cargo-muted) !important;

    font-size: 0.76rem !important;
    line-height: 1.3;
}


/* =========================================================
   TRANSPORT SPECIFICATIONS
   ========================================================= */

.transport-specs {
    min-width: 170px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;

    font-size: 0.77rem;
}

.transport-specs .dimensions {
    color: #475569;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;

    line-height: 1.45;
}

.transport-specs .dimensions > i {
    margin-right: 2px;
    color: #94a3b8 !important;
}

.transport-specs strong {
    color: var(--cargo-primary);
    font-weight: 700;
}


/* =========================================================
   HEIGHT
   ========================================================= */

.transport-specs .height-alert {
    display: inline-flex;
    align-items: center;

    padding: 2px 5px;

    color: var(--cargo-yellow);

    background: var(--cargo-yellow-bg);

    border: 1px solid #f5df9b;
    border-radius: 4px;

    font-weight: 650;
}


/* =========================================================
   WEIGHT
   ========================================================= */

.transport-specs .weight-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    width: fit-content;

    padding: 4px 8px;

    color: #166534;
    background: var(--cargo-green-bg);

    border: 1px solid #bbf7d0;
    border-radius: 5px;

    font-size: 0.72rem;
    font-weight: 750;
}

.transport-specs .weight-badge i {
    color: #16a34a;
    font-size: 0.7rem;
}


/* =========================================================
   CONTACT
   ========================================================= */

.contact-info {
    min-height: 32px;

    padding: 5px 8px;

    color: #2563eb;

    background: #eff6ff;

    border: 1px solid #dbeafe;
    border-radius: 5px;

    font-size: 0.77rem;
    font-weight: 700;

    white-space: nowrap;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    transition:
        background var(--cargo-transition),
        border-color var(--cargo-transition),
        color var(--cargo-transition);
}

.contact-info:hover {
    color: #1d4ed8;

    background: #dbeafe;
    border-color: #bfdbfe;
}

.contact-info i {
    font-size: 0.7rem;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Razvuče lijevo i desno */
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px 0 4px 0;
    margin-top: 10px;
    border-top: 1px solid var(--cargo-border, #e2e8f0);
}

/* Grupa za lijeve elemente (brojevi stranica + dropdown) */
.pagination-left, 
.pagination > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Da dropdown za broj oglasa (20) bude visinski u ravni sa dugmićima */
.pagination select,
.pagination .ads-per-page-select {
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--cargo-border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.77rem;
    color: var(--cargo-text);
    outline: none;
}

/* Info o stranicama (Stranica 1 od 2...) */
.pagination-info {
    color: var(--cargo-muted);
    font-size: 0.73rem;
    margin: 0;
}

.pagination a {
    min-width: 34px;
    height: 34px;

    padding: 0 8px;

    color: var(--cargo-text);
    background: #fff;

    border: 1px solid var(--cargo-border);
    border-radius: 6px;

    font-size: 0.77rem;
    font-weight: 650;

    text-decoration: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        background var(--cargo-transition),
        border-color var(--cargo-transition),
        color var(--cargo-transition);
}

.pagination a:hover {
    color: var(--cargo-primary);
    background: #f1f5f9;
    border-color: #b9c5d2;
}

.pagination a.active {
    color: #fff;
    background: var(--cargo-primary);
    border-color: var(--cargo-primary);
}

.pagination-info {
    margin-top: 7px;

    color: var(--cargo-muted);

    font-size: 0.73rem;
    text-align: center;
}


/* =========================================================
   MODALS
   ========================================================= */

.search-modal-overlay,
.publish-modal-overlay,
#loadDetailsModal {
    position: fixed;
    inset: 0;

    padding: 20px;

    background: rgba(5, 12, 22, 0.72);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    display: none;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    z-index: 10000;
}

.search-modal-overlay {
    z-index: 10000;
}

#loadDetailsModal {
    z-index: 10500;
}

.publish-modal-overlay {
    z-index: 11000;
}


/* =========================================================
   MODAL CONTAINERS
   ========================================================= */

.search-modal,
.publish-modal,
.cargo-modal-content-wrapper {
    position: relative;

    width: min(680px, 100%);
    max-width: 680px;

    max-height: calc(100dvh - 40px);

    height: auto;
    min-height: 0;

    margin: 0;

    background: #fff;

    /*
       Uklonjen nepotreban okvir oko popup-a.
    */
    border: 0;

    border-radius: 12px;

    box-shadow: var(--cargo-shadow-lg);

    overflow: hidden;

    animation: cargoModalIn 0.22s ease;
}


/*
   SEARCH MODAL
*/

.search-modal {
    width: min(430px, 100%);
    max-width: 430px;

    display: flex;
    flex-direction: column;

    height: auto;
}


/*
   PUBLISH MODAL
*/

.table-container {
    max-height: 560px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.table-container thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    box-shadow: inset 0 -1px 0 var(--cargo-border, #e2e8f0);
}

.publish-modal {
    width: min(680px, 100%);
    max-width: 680px;

    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 120px);
    height: auto;
}


/*
   LOAD DETAILS MODAL
*/

.cargo-modal-content-wrapper {
    width: min(680px, 100%);
    max-width: 680px;

    overflow-y: auto;
}


/* =========================================================
   MODAL HEADER
   ========================================================= */

/*
   Search i Publish sada koriste istu boju
   kao glavno dugme Objavi oglas.
*/

.search-modal-header,
.publish-modal-header {
    flex: 0 0 auto;

    min-height: 62px;

    padding: 15px 18px;

    color: #fff;

    background: var(--cargo-action);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.search-modal-header h3,
.publish-modal-header h3 {
    margin: 0;

    color: #fff;

    font-size: 0.95rem;
    font-weight: 750;
    line-height: 1.3;

    display: flex;
    align-items: center;
    gap: 8px;
}


/*
   Ikonica više nije tirkizna.
*/

.search-modal-header h3 i,
.publish-modal-header h3 i {
    color: #fff;
    opacity: 0.95;
}


/* =========================================================
   MODAL CLOSE
   ========================================================= */

.search-modal-close,
.publish-modal-close {
    flex: 0 0 auto;

    width: 32px;
    height: 32px;

    padding: 0;

    color: #fff;
    background: transparent;

    border: 0;
    border-radius: 6px;

    font-size: 1.45rem;
    line-height: 1;

    cursor: pointer;

    opacity: 0.85;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition:
        background var(--cargo-transition),
        opacity var(--cargo-transition);
}

.search-modal-close:hover,
.publish-modal-close:hover {
    background: rgba(255,255,255,0.14);
    opacity: 1;
}


/* =========================================================
   MODAL BODY
   ========================================================= */

.search-modal-body,
.publish-modal-body {
    width: 100%;

    padding: 18px;

    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;

    /*
       Bitno:
       body više ne rasteže modal samo zato što
       postoji slobodan prostor.
    */
    flex: 0 1 auto;

    min-height: 0;
    height: auto;
}


/*
   SEARCH
*/

.search-modal-body {
    max-height: calc(100dvh - 145px);
}


/*
   PUBLISH
*/

.publish-modal-body {
    max-height: calc(100dvh - 145px);

    /*
       Ovo je najvažnija promjena za uklanjanje
       praznog prostora ispod forme.
    */
    flex: 0 1 auto;
}


/* =========================================================
   MODAL SCROLLBAR
   ========================================================= */

.search-modal-body::-webkit-scrollbar,
.publish-modal-body::-webkit-scrollbar,
.cargo-modal-content-wrapper::-webkit-scrollbar {
    width: 7px;
}

.search-modal-body::-webkit-scrollbar-track,
.publish-modal-body::-webkit-scrollbar-track,
.cargo-modal-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.search-modal-body::-webkit-scrollbar-thumb,
.publish-modal-body::-webkit-scrollbar-thumb,
.cargo-modal-content-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover,
.publish-modal-body::-webkit-scrollbar-thumb:hover,
.cargo-modal-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* =========================================================
   MODAL FOOTER
   ========================================================= */

.search-modal-footer,
.publish-modal-footer {
    flex: 0 0 auto;

    min-height: 0;
    height: auto;

    padding: 10px 18px;

    background: #fff;

    border-top: 1px solid var(--cargo-border-light);

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;
}


/*
   Search dugme
*/

.search-modal-footer .btn-submit {
    width: auto !important;
    min-width: 115px;

    height: 38px !important;
    min-height: 38px !important;

    margin: 0 !important;
}


/*
   Publish dugme
*/

.publish-modal-footer .btn-submit {
    width: auto !important;

    min-width: 155px;

    height: 38px;
    min-height: 38px;

    margin: 0;
}

.publish-modal-footer .btn-secondary {
    min-width: 100px;

    height: 38px;
    min-height: 38px;
}


/* =========================================================
   FORM FIELDS - STANDARD SEARCH + PUBLISH
   ========================================================= */

.search-modal-body input,
.search-modal-body select,
.search-modal-body textarea,
.publish-modal-body input,
.publish-modal-body select,
.publish-modal-body textarea {
    width: 100%;

    min-height: 40px;

    padding: 9px 11px;

    color: var(--cargo-text);
    background: #fff;

    border: 1px solid #d3dee9;
    border-radius: 7px;

    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;

    outline: none;
    box-shadow: none;

    transition:
        border-color var(--cargo-transition),
        box-shadow var(--cargo-transition),
        background var(--cargo-transition);
}


/*
   Hover
*/

.search-modal-body input:hover,
.search-modal-body select:hover,
.search-modal-body textarea:hover,
.publish-modal-body input:hover,
.publish-modal-body select:hover,
.publish-modal-body textarea:hover {
    border-color: #b9c7d5;
}


/*
   Focus
*/

.search-modal-body input:focus,
.search-modal-body select:focus,
.search-modal-body textarea:focus,
.publish-modal-body input:focus,
.publish-modal-body select:focus,
.publish-modal-body textarea:focus {
    border-color: var(--cargo-action);

    box-shadow:
        0 0 0 3px rgba(79,127,165,0.12);
}


/*
   Placeholder
*/

.search-modal-body input::placeholder,
.search-modal-body textarea::placeholder,
.publish-modal-body input::placeholder,
.publish-modal-body textarea::placeholder {
    color: #94a8bd;

    opacity: 1;
}


/*
   Disabled
*/

.search-modal-body input:disabled,
.search-modal-body select:disabled,
.search-modal-body textarea:disabled,
.publish-modal-body input:disabled,
.publish-modal-body select:disabled,
.publish-modal-body textarea:disabled {
    color: #64748b;
    background: #f1f5f9;

    cursor: not-allowed;
}


/* =========================================================
   LABELS - STANDARD SEARCH + PUBLISH
   ========================================================= */

.search-modal-body label,
.publish-modal-body label {
    display: block;

    margin: 0 0 5px;

    color: #475b72;

    font-size: 0.72rem;
    font-weight: 700;

    line-height: 1.3;
}


/* =========================================================
   SEARCH FIELD WIDTH
   ========================================================= */

/*
   Search popup je uži od Publish popupa.

   Polja ne trebaju zauzimati punu širinu popupa.
   360px približno odgovara širini jednog polja
   u Publish formi.
*/

.search-modal-body .form-group {
    width: 100%;
    max-width: 360px;

    margin-left: 0;
    margin-right: auto;
}


/*
   Datum u Searchu dobija isti tretman kao
   sva ostala Search polja.
*/

.search-modal-body #s_datum {
    width: 100%;
    max-width: 360px;
}


/* =========================================================
   FORMS
   ========================================================= */

.cargo-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.form-group {
    position: relative;

    width: 100%;
    min-width: 0;

    margin: 0;
}

.form-row {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 9px;

    margin: 0;
}


/* =========================================================
   PUBLISH FORM
   ========================================================= */

.publish-form {
    min-height: 0;

    display: flex;
    flex-direction: column;
}

.publish-modal-body .cargo-form {
    gap: 9px;
}

.publish-modal-body fieldset {
    margin: 4px 0;
}

.publish-modal-body .form-group {
    margin: 0;
}


/* =========================================================
   MOBILE MODALS
   ========================================================= */

@media (max-width: 600px) {

    .search-modal-overlay,
    .publish-modal-overlay,
    #loadDetailsModal {
        padding: 10px;
    }

    .search-modal,
    .publish-modal,
    .cargo-modal-content-wrapper {
        width: 100%;
        max-width: 100%;

        max-height: calc(100dvh - 20px);

        height: auto;
        min-height: 0;

        border-radius: 10px;
    }

    .search-modal-header,
    .publish-modal-header {
        min-height: 58px;

        padding: 13px 14px;
    }

    .search-modal-body,
    .publish-modal-body {
        padding: 14px !important;

        flex: 0 1 auto !important;

        height: auto !important;
        min-height: 0 !important;

        max-height: calc(100dvh - 135px);
    }

    .search-modal-body {
        max-height: calc(100dvh - 135px);
    }

    /*
       Na mobitelu Search polja koriste punu raspoloživu
       širinu jer nema smisla ostavljati 360px ako je
       ekran uzak.
    */

    .search-modal-body .form-group {
        width: 100%;
        max-width: 100%;

        margin-left: 0;
        margin-right: 0;
    }

    .search-modal-body #s_datum {
        width: 100%;
        max-width: 100%;
    }

    .search-modal-footer,
    .publish-modal-footer {
        min-height: 0 !important;
        height: auto !important;

        padding: 9px 14px !important;

        flex-direction: column-reverse;
        align-items: stretch;

        gap: 7px;
    }

    .search-modal-footer button,
    .publish-modal-footer button,
    .search-modal-footer .btn-secondary,
    .publish-modal-footer .btn-secondary,
    .search-modal-footer .btn-submit,
    .publish-modal-footer .btn-submit {
        width: 100% !important;
        min-width: 100% !important;

        min-height: 43px;
        height: 43px !important;

        margin: 0 !important;
    }

    .cargo-modal-container {
        padding: 16px;
    }

    .cargo-modal-header {
        margin-bottom: 14px;
    }
}


/* =========================================================
   VERY SMALL PHONES — MODALS
   ========================================================= */

@media (max-width: 400px) {

    .search-modal-overlay,
    .publish-modal-overlay,
    #loadDetailsModal {
        padding: 8px;
    }

    .search-modal,
    .publish-modal,
    .cargo-modal-content-wrapper {
        max-height: calc(100dvh - 16px);

        border-radius: 9px;
    }

    .search-modal-header,
    .publish-modal-header {
        min-height: 56px;

        padding: 12px;
    }

    .search-modal-body,
    .publish-modal-body {
        padding: 12px !important;
    }

    .cargo-modal-container {
        padding: 14px;
    }
}


/* =========================================================
   LOAD DETAILS MODAL CONTENT
   ========================================================= */

.cargo-modal-container {
    padding: 26px;
}

.close-cargo-modal {
    position: absolute;

    top: 14px;
    right: 16px;

    z-index: 10;

    width: 36px;
    height: 36px;

    padding: 0;

    color: #64748b;
    background: #f1f5f9;

    border: 0;
    border-radius: 50%;

    font-size: 20px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        background var(--cargo-transition),
        color var(--cargo-transition),
        transform var(--cargo-transition);
}

.close-cargo-modal:hover {
    color: #0f172a;
    background: #e2e8f0;
    transform: rotate(3deg);
}

.cargo-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 18px;
    padding-right: 48px;

    flex-wrap: wrap;
}

.cargo-type-badge {
    padding: 6px 11px;

    border-radius: 5px;

    font-size: 0.67rem;
    font-weight: 750;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cargo-id {
    padding: 4px 8px;

    color: #64748b;
    background: #f1f5f9;

    border-radius: 4px;

    font-size: 0.72rem;
    font-weight: 650;
}


/* =========================================================
   TIMELINE / ROUTE DETAIL
   ========================================================= */

.cargo-timeline-box,
.cargo-route-box {
    padding: 15px;

    margin-bottom: 17px;

    background: #f8fafc;

    border: 1px solid var(--cargo-border-light);
    border-radius: 8px;
}

.timeline-row {
    position: relative;

    display: flex;
}

.timeline-row:not(:last-child) {
    margin-bottom: 15px;
}

.timeline-icon-col {
    width: 16px;

    flex: 0 0 16px;

    margin-right: 12px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-dot {
    width: 10px;
    height: 10px;

    flex: 0 0 10px;

    margin-top: 5px;

    border-radius: 50%;

    z-index: 2;
}

.load-dot {
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.unload-dot {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

.timeline-line {
    width: 2px;

    flex-grow: 1;

    margin-top: 4px;
    margin-bottom: -15px;

    background: #cbd5e1;
}

.timeline-content-col {
    flex-grow: 1;
    min-width: 0;
}

.timeline-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
    flex-wrap: wrap;

    margin-bottom: 5px;
}

.timeline-tag {
    padding: 3px 6px;

    border-radius: 4px;

    font-size: 0.63rem;
    font-weight: 750;

    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.load-tag {
    color: #2563eb;
    background: #eff6ff;
}

.unload-tag {
    color: #16a34a;
    background: #f0fdf4;
}

.timeline-date,
.route-date {
    padding: 3px 7px;

    color: #475569;
    background: #fff;

    border: 1px solid var(--cargo-border-light);
    border-radius: 4px;

    font-size: 0.68rem;
    font-weight: 650;

    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.timeline-location,
.route-point {
    color: #334155;

    font-size: 0.88rem;
    line-height: 1.4;
}

.timeline-location strong,
.route-point strong {
    color: #0f172a;
    font-size: 0.9rem;
}


/* =========================================================
   CARGO SPECS
   ========================================================= */

.cargo-specs-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 9px;

    margin-bottom: 17px;
}

.spec-item {
    padding: 11px 13px;

    background: #f8fafc;

    border: 1px solid var(--cargo-border-light);
    border-radius: 8px;
}

.spec-label {
    display: block;

    margin-bottom: 4px;

    color: #64748b;

    font-size: 0.65rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.spec-value {
    color: #0f172a;

    font-size: 0.82rem;
    font-weight: 600;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.cargo-description {
    padding: 13px;

    margin-bottom: 17px;

    background: #f8fafc;

    border: 1px solid var(--cargo-border-light);
    border-radius: 8px;
}

.cargo-description p {
    margin: 4px 0 0;

    color: #475569;

    font-size: 0.78rem;
    line-height: 1.55;
}


/* =========================================================
   CARGO FOOTER
   ========================================================= */

.cargo-footer-info {
    padding-top: 17px;
    margin-top: 7px;

    border-top: 1px solid var(--cargo-border-light);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    flex-wrap: wrap;
}

.company-link {
    display: flex;
    align-items: center;
    gap: 7px;

    text-decoration: none;

    font-size: 0.8rem;
    font-weight: 650;
}

.registered-company {
    color: #2563eb;
}

.registered-company:hover {
    text-decoration: underline;
}

.unregistered-user {
    color: #64748b;
}

.verified-badge {
    padding: 2px 6px;

    color: #1d4ed8;
    background: #dbeafe;

    border-radius: 4px;

    font-size: 0.59rem;
    font-weight: 750;

    text-transform: uppercase;
}

.btn-call-cargo {
    min-height: 38px;

    padding: 0 15px;

    color: #fff;
    background: #16a34a;

    border-radius: 6px;

    text-decoration: none;

    font-size: 0.8rem;
    font-weight: 700;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    box-shadow: 0 3px 8px rgba(22,163,74,0.16);

    transition:
        background var(--cargo-transition),
        box-shadow var(--cargo-transition),
        transform var(--cargo-transition);
}

.btn-call-cargo:hover {
    color: #fff;
    background: #15803d;

    box-shadow: 0 5px 12px rgba(22,163,74,0.24);

    transform: translateY(-1px);
}

.btn-call-cargo:active {
    transform: translateY(0);
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert-success,
.alert-error {
    padding: 9px 11px;

    margin: 0 0 9px;

    border-radius: 7px;

    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.4;

    border: 1px solid transparent;
}

.alert-success {
    color: var(--cargo-green);
    background: var(--cargo-green-bg);
    border-color: #bbf7d0;
}

.alert-error {
    color: var(--cargo-red);
    background: var(--cargo-red-bg);
    border-color: #fecaca;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes cargoModalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 1200px) {

    .cargo-card {
        padding: 22px;
    }

    table {
        font-size: 0.84rem;
    }

    th {
        padding: 13px;
    }

    td {
        padding: 14px 13px;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .main-content {
        padding: 18px 0 30px;
    }

    .cargo-layout {
        width: calc(100% - 24px);
    }

    .cargo-card {
        padding: 16px;
    }

    .cargo-card > h2 {
        gap: 9px;
    }

    .ads-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .pro-promo-mini {
        margin-left: auto;
    }

    .publish-modal {
        max-height: calc(100dvh - 30px);
    }
}


/* =========================================================
   SMALL TABLET
   ========================================================= */

@media (max-width: 700px) {

    .cargo-card > h2 {
        align-items: flex-start;
    }

    .cargo-card > h2 > span {
        width: 100%;
        margin-right: 0;
    }

    .pro-promo-mini {
        margin-left: 0;
    }

    .ads-actions {
        width: 100%;
    }

    .ads-actions > * {
        flex: 1 1 auto;
    }

    .table-container {
        max-height: 60dvh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cargo-specs-grid {
        grid-template-columns: 1fr;
    }

    .cargo-footer-info {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-call-cargo {
        width: 100%;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .main-content {
        padding: 10px 0 20px;
    }

    .cargo-layout {
        width: calc(100% - 12px);
    }

    .cargo-card {
        padding: 12px;

        border-radius: 8px;
    }

    .cargo-card > h2 {
        margin-bottom: 12px;
        padding-bottom: 11px;

        font-size: 0.94rem;
    }

    .pro-promo-mini {
        height: 34px;
        min-height: 34px;

        padding: 0 9px;

        font-size: 0.7rem;
    }

    .btn-publish-trigger,
    .btn-search-trigger,
    .btn-reset-filters {
        min-height: 36px;
    }

    .ads-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 6px;
    }

    .ads-actions .btn-reset-filters {
        grid-column: 1 / -1;
    }

    .ads-actions > * {
        width: 100%;
    }

    table {
        min-width: 850px;
    }

    th,
    td {
        padding: 9px 9px;
    }

    th {
        font-size: 0.67rem;
    }

    td {
        font-size: 0.78rem;
    }

    .transport-specs {
        min-width: 155px;
    }

    .search-modal-overlay,
    .publish-modal-overlay,
    #loadDetailsModal {
        padding: 10px;
    }

    .search-modal,
    .publish-modal,
    .cargo-modal-content-wrapper {
        width: 100%;
        max-width: 100%;

        max-height: calc(100dvh - 20px);

        height: auto;
        min-height: 0;

        border-radius: 9px;
    }

    .search-modal-body {
        max-height: calc(100dvh - 135px);

        padding: 14px !important;
    }

    .publish-modal-body {
        max-height: calc(100dvh - 135px);

        padding: 14px !important;
    }

    .search-modal-footer,
    .publish-modal-footer {
        padding: 9px 14px !important;

        flex-direction: column-reverse;

        gap: 7px;
    }

    .search-modal-footer button,
    .publish-modal-footer button,
    .search-modal-footer .btn-secondary,
    .publish-modal-footer .btn-secondary,
    .search-modal-footer .btn-submit,
    .publish-modal-footer .btn-submit {
        width: 100% !important;
        min-width: 100% !important;

        min-height: 43px;
        height: 43px !important;

        margin: 0 !important;
    }

    .cargo-modal-container {
        padding: 20px 16px;
    }

    .cargo-modal-header {
        margin-bottom: 14px;
    }

    .cargo-timeline-box,
    .cargo-route-box {
        padding: 12px;
    }

    .cargo-description {
        padding: 12px;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 400px) {

    .cargo-layout {
        width: calc(100% - 8px);
    }

    .cargo-card {
        padding: 10px;
    }

    .ads-actions {
        grid-template-columns: 1fr;
    }

    .ads-actions .btn-reset-filters {
        grid-column: auto;
    }

    .pro-promo-mini {
        width: 100%;
    }

    .cargo-card > h2 {
        gap: 7px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        min-height: 42px;
    }

    .btn-submit {
        min-height: 44px;
    }


    /* ---------------------------------------------
       MODAL POLJA NA VRLO MALIM EKRANIMA
       --------------------------------------------- */

    .search-modal-body input,
    .search-modal-body select,
    .search-modal-body textarea,
    .publish-modal-body input,
    .publish-modal-body select,
    .publish-modal-body textarea {
        min-height: 42px;
    }

    .search-modal-body .form-group {
        max-width: 100%;
    }
}


/* =========================================================
   ACCESSIBILITY / FOCUS
   ========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--cargo-accent);
    outline-offset: 2px;
}


/* =========================================================
   REDUCE MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}