/* ============================================================
   Container Loading Calculator — Gov.gr Design System
   ============================================================ */

:root {
    --blue:    #003476;
    --blue2:   #0066CC;
    --bg:      #F5F5F5;
    --text:    #1A1A1A;
    --border:  #CCCCCC;
    --warn:    #E67E22;
    --danger:  #C0392B;
    --success: #1A7A4A;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
}

/* ---- Header ---- */
.site-header {
    background: var(--blue);
    color: #fff;
    padding: 0;
    border-bottom: 3px solid var(--blue2);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* ---- Language switcher ---- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.lang-switcher a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.lang-switcher a:hover,
.lang-switcher a.lang-active {
    color: #fff;
    text-decoration: underline;
}

.lang-sep {
    color: rgba(255,255,255,0.4);
}

/* ---- Hero strip ---- */
.hero-strip {
    background: #e8eef7;
    border-bottom: 2px solid var(--blue);
    padding: 10px 24px;
    font-size: 14px;
    color: var(--blue);
}

/* ---- Page content wrapper ---- */
.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ---- Cards ---- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    padding: 20px 24px;
}

.card-title {
    font-size: 17px;
    font-weight: bold;
    color: var(--blue);
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--blue);
}

/* ---- Step 1 grid ---- */
.step1-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 700px) {
    .step1-grid { grid-template-columns: 1fr; }
}

.group-label {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
    margin: 0 0 10px;
}

/* ---- Radio cards ---- */
.radio-card {
    display: block;
    border: 2px solid var(--border);
    padding: 10px 14px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.radio-card:hover {
    border-color: var(--blue2);
    background: #f0f5ff;
}

.radio-card--selected {
    border-color: var(--blue);
    background: #e8eef7;
}

.radio-card input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--blue);
}

.radio-card__name {
    font-weight: bold;
    display: inline;
}

.radio-card__dims,
.radio-card__weight {
    display: block;
    font-size: 12px;
    color: #555;
    margin-left: 24px;
}

/* ---- Editor toolbar ---- */
.editor-toolbar {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Table ---- */
.table-wrap {
    overflow-x: auto;
}

.editor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.editor-table th {
    background: var(--blue);
    color: #fff;
    padding: 7px 8px;
    text-align: left;
    white-space: nowrap;
    border: 1px solid var(--blue);
}

.editor-table td {
    padding: 4px 6px;
    border: 1px solid var(--border);
    background: #fff;
}

.editor-table tr:nth-child(even) td {
    background: #f9f9f9;
}

.col-del  { width: 32px; text-align: center; }
.col-desc { min-width: 140px; }
.col-num  { width: 90px; }
.col-bool { width: 80px; text-align: center; }

.editor-table input[type="text"],
.editor-table input[type="number"] {
    width: 100%;
    border: 1px solid var(--border);
    padding: 3px 5px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.editor-table input[type="text"]:focus,
.editor-table input[type="number"]:focus {
    outline: 2px solid var(--blue);
    outline-offset: -1px;
}

.editor-table input.invalid {
    background: #ffe0e0;
    border-color: var(--danger);
}

.editor-table input[type="checkbox"] {
    accent-color: var(--blue);
    width: 16px;
    height: 16px;
}

/* ---- Submit section ---- */
.submit-section {
    margin: 8px 0 24px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 9px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:focus {
    outline: 3px solid var(--blue2);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.btn-primary:hover {
    background: var(--blue2);
    border-color: var(--blue2);
}

.btn-secondary {
    background: #fff;
    color: var(--blue);
    border-color: var(--blue);
}

.btn-secondary:hover {
    background: var(--blue);
    color: #fff;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ---- Alerts ---- */
.alert {
    padding: 10px 14px;
    border: 2px solid;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-danger  { background: #fdf0f0; border-color: var(--danger); color: var(--danger); }
.alert-warning { background: #fff8e6; border-color: var(--warn);   color: #8a4500; }

/* ---- Results section ---- */
.section-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--blue);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--blue);
    margin-bottom: 16px;
}

.results-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

@media (max-width: 800px) {
    .results-grid { grid-template-columns: 1fr; }
}

/* ---- Summary card ---- */
.summary-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 18px 20px;
}

.summary-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--blue);
    margin: 0 0 12px;
}

.summary-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.summary-dl dt {
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

.summary-dl dd {
    margin: 0;
}

.text-warning { color: var(--warn); }

/* ---- Progress bars ---- */
.summary-bars { margin-bottom: 14px; }

.bar-label {
    font-size: 12px;
    color: #555;
    margin-bottom: 3px;
    margin-top: 6px;
}

.bar-track {
    height: 12px;
    background: #e0e0e0;
    width: 100%;
}

.bar-fill {
    height: 100%;
    background: var(--blue);
    transition: width 0.4s;
}

.bar-fill--warn { background: var(--warn); }

.mt-2 { margin-top: 12px; }

/* ---- Viewer card ---- */
.viewer-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.canvas-wrap {
    flex: 1;
    min-height: 380px;
    background: #1a1a2e;
    position: relative;
}

.canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#webgl-fallback {
    color: #aaa;
    padding: 20px;
    font-size: 13px;
}

.camera-btns {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.container-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

/* ---- Field errors ---- */
.field-error {
    color: var(--danger);
    font-size: 12px;
    margin: 4px 0 0;
}

/* ---- Delete row button ---- */
.btn-del {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    font-weight: bold;
}

.btn-del:hover {
    background: #fdf0f0;
}

/* ---- Paste zone ---- */
.paste-zone {
    border: 2px dashed var(--blue2);
    background: #f0f5ff;
    color: var(--blue);
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.15s, border-color 0.15s;
    outline: none;
}

.paste-zone:focus,
.paste-zone.focused {
    background: #dce8ff;
    border-color: var(--blue);
}

/* ---- Modal overlay ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    max-width: 560px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box h3 {
    font-size: 16px;
    font-weight: bold;
    color: var(--blue);
    margin: 0 0 12px;
}

.modal-box p {
    font-size: 13px;
    margin: 8px 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ---- XLS mapping grid ---- */
.xls-mapping-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.xls-mapping-row label {
    font-size: 13px;
    font-weight: bold;
    color: var(--text);
}

.xls-map-select {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
}

.xls-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.xls-header-chip {
    background: #e8eef7;
    color: var(--blue);
    border: 1px solid var(--blue2);
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
}

.text-muted {
    color: #777;
    font-size: 12px !important;
}

/* ---- Mode toggle ---- */
.mode-toggle {
    display: flex;
    margin-bottom: 20px;
    border: 2px solid var(--blue);
}

.mode-btn {
    flex: 1;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    background: #fff;
    color: var(--blue);
    transition: background 0.15s, color 0.15s;
    text-align: center;
}

.mode-btn + .mode-btn {
    border-left: 2px solid var(--blue);
}

.mode-btn--active {
    background: var(--blue);
    color: #fff;
}

/* ---- Mode-driven visibility ---- */
body.mode-pallet    [data-show-mode="container"] { display: none; }
body.mode-container [data-show-mode="pallet"]    { display: none; }
body.mode-pallet    .pallet-none-option          { display: none; }
.col-on-pallet                                   { display: none; }

/* ---- Footer ---- */
.site-footer {
    background: var(--blue);
    color: #fff;
    margin-top: 32px;
    padding: 12px 24px;
    font-size: 12px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}
