/*!
 * jquery.productConfigurator.sub.quartz.css
 * Izolovani stilovi (cms-quartz- prefiks) — ne oslanja se na Bootstrap v3/v5
 * specifične klase, radi identično bez obzira na učitanu verziju.
 */

.cms-quartz-wrapper {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #222;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cms-quartz-notify {
    display: none;
    background: #fdecea;
    color: #a71d2a;
    border: 1px solid #f5c6cb;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    flex: 0 0 auto;
}
.cms-quartz-notify-show { display: block; }

/* Jedan red, dve kolone (5. Korisnički interfejs) — puni preostali prostor dijaloga */
.cms-quartz-main-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0; /* da canvas-col overflow radi unutar flex-a */
}

.cms-quartz-canvas-col {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #ddd;
    background: #fafafa;
    position: relative;
}

/* Relativni "stage" — zum/pan kontrole se pozicioniraju apsolutno unutar njega, preko crteža */
.cms-quartz-canvas-stage {
    position: relative;
    width: 100%;
    height: 100%;
}

.cms-quartz-svg-wrap {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 10px;
    box-sizing: border-box;
}

.cms-quartz-svg-wrap svg {
    display: block;
    transform-origin: 0 0;
    transition: transform 0.05s linear;
}

/* Zum/pan kontrole — apsolutno, PREKO svg-a (gornji-levi ugao crteža).
   Kompaktan, moderan "glass" izgled (blur pozadina, sitni okrugli tasteri). */
.cms-quartz-zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.cms-quartz-zbtn {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: #444;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.cms-quartz-zbtn:hover { background: #2e6da4; color: #fff; }
.cms-quartz-zbtn:active { transform: scale(0.92); }

.cms-quartz-zoom-btns {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cms-quartz-pan-pad {
    display: grid;
    grid-template-columns: repeat(3, 22px);
    grid-template-rows: repeat(2, 22px);
    gap: 2px;
    padding-top: 4px;
}
.cms-quartz-pan-up    { grid-column: 2; grid-row: 1; }
.cms-quartz-pan-left  { grid-column: 1; grid-row: 2; }
.cms-quartz-pan-right { grid-column: 3; grid-row: 2; }
.cms-quartz-pan-down  { grid-column: 2; grid-row: 2; }

.cms-quartz-side-col {
    flex: 0 0 480px;
    max-width: 480px;
    overflow-y: auto;
    min-height: 0;
}

/* ---- panels (izgled nalik Bootstrap 5 "card" komponenti, ali potpuno izolovano
   od stvarnih Bootstrap klasa — radi identično bez obzira na učitanu verziju) ---- */
.cms-quartz-panel {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
}
.cms-quartz-panel:last-child { margin-bottom: 0; }

.cms-quartz-panel-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #495057;
}

.cms-quartz-panel-body {
    padding: 10px 12px;
}

.cms-quartz-layout-buttons,
.cms-quartz-corner-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cms-quartz-tool-group {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e2e2;
}
.cms-quartz-tool-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cms-quartz-tool-group > label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
}

.cms-quartz-dim-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 6px;
}
.cms-quartz-axis-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #eef2f6;
    color: #2e6da4;
    font-weight: 700;
    font-size: 11px;
    flex: 0 0 auto;
}
.cms-quartz-dim-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 11px;
}
.cms-quartz-unit { color: #999; }

/* ---- buttons / inputs (izolovano, ne diramo bootstrap .btn) ---- */
.cms-quartz-btn {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid #999;
    background: #f5f5f5;
    color: #333;
    border-radius: 3px;
    cursor: pointer;
}
.cms-quartz-btn:hover { background: #eaeaea; }
.cms-quartz-btn.cms-quartz-active {
    background: #2e6da4;
    border-color: #2e6da4;
    color: #fff;
}

.cms-quartz-btn-icon {
    border: none;
    background: transparent;
    color: #a71d2a;
    cursor: pointer;
    font-size: 12px;
}

.cms-quartz-select,
.cms-quartz-input-sm {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin: 2px 2px 2px 0;
}
.cms-quartz-input-sm { width: 70px; }

/* ---- specs table ---- */
.cms-quartz-specs { font-size: 12px; }
.cms-quartz-specs-subtitle {
    font-weight: bold;
    margin: 10px 0 4px;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
}
.cms-quartz-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4px;
}
.cms-quartz-specs-table th,
.cms-quartz-specs-table td {
    text-align: left;
    padding: 3px 6px;
    border-bottom: 1px solid #eee;
}

/* ---- SVG elementi tehničkog crteža ---- */
.cms-quartz-contour {
    fill: #e4dccf;
    stroke: #333;
    stroke-width: 2;
}

.cms-quartz-cutline {
    stroke: #999;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.cms-quartz-cutout {
    fill: #ffffff;
    stroke: #a71d2a;
    stroke-width: 1.5;
    cursor: move;
}

.cms-quartz-finishing-marker {
    fill: #2e9e3f;
    stroke: #1c6b28;
    stroke-width: 1;
    cursor: ew-resize;
}

.cms-quartz-resize-handle {
    fill: #2e6da4;
    stroke: #1b4a75;
    cursor: grab;
}
.cms-quartz-resize-handle:active { cursor: grabbing; }

.cms-quartz-dim-line,
.cms-quartz-dim-line-total,
.cms-quartz-dim-line-finishing {
    stroke: #666;
    stroke-width: 1;
}
.cms-quartz-dim-line-total { stroke: #222; stroke-width: 1.3; }
.cms-quartz-dim-line-finishing { stroke: #2e9e3f; }

.cms-quartz-dim-ext {
    stroke: #bbb;
    stroke-width: 0.75;
}

.cms-quartz-dim-text,
.cms-quartz-dim-text-total,
.cms-quartz-dim-text-finishing,
.cms-quartz-seg-label,
.cms-quartz-depth-label {
    font-size: 11px;
    fill: #333;
    font-family: Arial, Helvetica, sans-serif;
}
.cms-quartz-dim-text-total { font-weight: bold; }
.cms-quartz-dim-text-finishing { fill: #1c6b28; }
.cms-quartz-seg-label { fill: #888; font-size: 10px; }
.cms-quartz-depth-label { fill: #555; font-style: italic; }

/* ---- BootstrapDialog override (izolovano, ne menja globalne .modal stilove) ---- */
.cms-quartz-dialog .modal-dialog,
.cms-quartz-dialog.modal-dialog {
    width: 96vw;
    max-width: 1200px;
}

/*
 * Fullscreen modal — Bootstrap 5 ima ugrađenu .modal-fullscreen klasu, ali
 * Bootstrap 3 nema, pa pravimo sopstvenu (cssClass prosleđen kroz
 * BootstrapDialog.show) koja radi identično bez obzira na učitanu verziju.
 * BootstrapDialog kod obe verzije generiše .modal-dialog > .modal-content
 * strukturu, pa su selektori namerno "descendant" (bez pretpostavke da je
 * klasa direktno na .modal-dialog elementu).
 */
.cms-quartz-dialog-fullscreen,
.cms-quartz-dialog-fullscreen .modal-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    top: 0 !important;
    left: 0 !important;
    position: fixed !important;
}
.cms-quartz-dialog-fullscreen .modal-content {
    height: 100vh !important;
    min-height: 0;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
}
.cms-quartz-dialog-fullscreen .modal-header,
.cms-quartz-dialog-fullscreen .modal-footer {
    flex: 0 0 auto;
}
.cms-quartz-dialog-fullscreen .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important; /* Bootstrap (v3 i v5) po default-u ograničava modal-body visinu — to je pravilo veliki prazan prostor ispod sadržaja */
    overflow: hidden;
    display: flex;
    padding: 10px;
}
.cms-quartz-dialog-fullscreen .modal-body .cms-quartz-wrapper {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

@media (max-width: 900px) {
    .cms-quartz-main-row { flex-direction: column; }
    .cms-quartz-side-col { max-width: 100%; flex-basis: auto; }
    .cms-quartz-canvas-stage { min-height: 320px; }
}
