html {
    font-size: 18px;
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: auto;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.jobs-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.add-job-button {
    background-color: #bbb;
    color: #333;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}
.add-job-button:hover {
    background-color: #999;
}

.jobs-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.jobs-tabs button {
    font-size: 14px;
    padding: 4px 10px;
    cursor: pointer;
    user-select: none;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 4px;
    background: #fff;
    border: 2px solid var(--tab-color, #333);
    color: var(--tab-color, #333);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.jobs-tabs button:hover {
    background: var(--tab-color, #333);
    color: #fff;
}
.jobs-tabs button.active {
    background: var(--tab-color, #333);
    color: #fff;
    border: 2px solid var(--tab-color, #333);
}

.top-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.icon-button {
    background: #eee;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.icon-button span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.icon-button:hover {
    background: #ddd;
}

.sidebar {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    overflow: auto;
}

.sidebar input, .sidebar select {
    background: #fff;
    color: #333;
}

.sidebar input:focus, .sidebar select:focus {
    border-color: var(--job-color);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 16px;
    font-weight: 600;
    color: #444;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
    padding: 8px;
    border: 2px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.3s ease;
    color: #333;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: space-between;
}

.filter-buttons button {
    flex: 1 1 auto;
    padding: 6px 8px;
    background-color: #fff;
    color: var(--job-color, #333);
    border: 2px solid var(--job-color, #333);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.filter-buttons button.active,
.filter-buttons button:hover {
    background-color: var(--job-color, #333);
    color: #fff;
    border-color: var(--job-color, #333);
}

.dimension-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.dimension-buttons button {
    background-color: #ccc;
    color: #333;
    border: 2px solid #bbb;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.dimension-buttons button:hover {
    background-color: var(--job-color, #333);
    color: #fff;
    border-color: #111;
}

.dimension-buttons button.selected-dimension {
    background-color: var(--job-color, #333);
    color: #fff;
    font-weight: 700;
    border-color: #111;
}

.main-content {
    flex: 1;
    background: #f5f5f5;
    overflow: auto;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.paper-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 10px 0;
    box-sizing: border-box;
}

.job-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.job-name-subtle {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #e9e9e9;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.paper-wrapper-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    overflow-x: auto;
    width: 100%;
}

.paper-wrapper {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}
.paper-wrapper:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.paper {
    position: relative;
    background-color: white;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.paper-border {
    position: relative;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.paper-wrapper .double-sided {
    box-shadow: inset 0 0 0 2px var(--job-color, #333);
    border: none;
}

.safe-zone {
    position: relative;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 3px;
    overflow: hidden;
}

.image-container {
    display: grid;
    place-items: center;
}

.image {
    background-color: gray;
    border: 1px solid #fff;
    border-radius: 1mm;
    transition: all 0.3s ease;
}

.paper-name {
    font-size: 16px;
    font-weight: 700;
    margin: 8px 0 5px;
    color: #333;
    letter-spacing: 0.5px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.paper-info {
    font-size: 16px;
    color: #333;
    margin-top: 5px;
    margin-bottom: 5px;
    line-height: 1.5;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
}

.cost-details {
    width: 100%;
    margin-top: 10px;
    overflow-x: auto;
    text-align: center;
}

.cost-table {
    width: 100%;
    max-width: 300px; /* sužili smo da ne bude prevelika */
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #ddd;
}

.cost-table tr:hover {
    background-color: #eee;
}

.cost-table th, .cost-table td {
    border: 1px solid #ddd;
    padding: 6px; /* malo manji padding */
    text-align: center;
}
.cost-table th {
    background-color: #f7f7f7;
    font-weight: 700;
    color: #333;
}
.cost-table th:nth-child(1), .cost-table td:nth-child(1) {
    font-weight: bold;
    color: #222;
}
.cost-table th:nth-child(2), .cost-table td:nth-child(2) {
    font-weight: bold;
    color: #000;
}

/* Za BW mod */
.bw-mode .image {
    background-color: #555 !important;
}

/* Klase za cenu i formulu */
.price-amount {
    font-weight: 700;
    font-size: 16px;
    color: #333;
    line-height: 1.4;
}
.price-formula {
    font-size: 14px;
    color: #777;
    line-height: 1.3;
}

.highlight-input {
    border-color: var(--job-color, #333) !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2) !important;
}

@media (max-width: 768px) {
    body {
        height: auto;
        overflow: visible;
        display: block;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .container {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
        flex: none;
        flex-grow: 1;
    }

    .paper-container {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        height: auto;
        overflow: visible;
        display: block;
    }
    .top-header {
        gap: 10px;
    }
    .top-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .jobs-control {
        flex-wrap: wrap;
        width: 100%;
    }
    .jobs-tabs {
        flex-basis: 100%;
    }

    .cost-table th, .cost-table td {
        font-size: 12px;
        padding: 4px;
    }
}

/* Popup styling */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.popup-overlay.active {
    display: flex;
}

.popup {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    0% {transform: scale(0.9); opacity:0;}
    100% {transform: scale(1); opacity:1;}
}

.popup h2 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 10px;
}
.popup input {
    width: 100%;
    font-size: 16px;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}
.popup-buttons button {
    background: var(--job-color, #333);
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.popup-buttons button:hover {
    background: #444;
}