/* public/style.css (fixed version) */

body {
    font-family: sans-serif;
    margin: 2em;
    background: #f9f9f9;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 2em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

h1 {
    color: #333;
}

/* -- Controls layout -- */
.controls {
    margin-bottom: 1.5em;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* two columns per row */
    gap: 1em;
    align-items: flex-end;
}

.controls div {
    flex: 1;
}

#start-button {
    grid-column: 1 / -1;
    /* span all columns */
    margin-top: 1em;
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 0.5em;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

button {
    background: #007bff;
    color: white;
    padding: 0.75em 1.5em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* -- Login screen -- */
#google-login-btn {
    background: #db4437;
    font-size: 1.2em;
    padding: 0.8em;
    width: 100%;
}

#google-login-btn:hover {
    background: #c33b2e;
}

#main-app {
    display: none;
}

#login-screen {
    text-align: center;
}

.note {
    text-align: center;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.75em;
    border-radius: 4px;
    margin-top: 0;
}

/* -- Progress bar -- */
#progress-bar {
    width: 100%;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    height: 2em;
    margin-top: 0.5em;
    display: flex;
}

#progress-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.1s ease;
}

#progress-fail {
    height: 100%;
    background: #dc3545;
    /* red */
    transition: width 0.1s ease;
}

#progress-text {
    text-align: center;
    margin-top: 0.5em;
    font-weight: 600;
    font-size: 1.2em;
}

.failed-text {
    color: #dc3545;
    margin-left: 1em;
}

/* -- Worker monitor -- */
#worker-monitor {
    margin-top: 2em;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1em;
}

.worker-box {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1em;
    text-align: center;
    transition: background 0.1s ease;
}

.worker-box .id {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
}

.worker-box .count {
    font-size: 1.5em;
    color: #007bff;
    margin-top: 0.5em;
}

.worker-box.active {
    background: #cce5ff;
    border-color: #007bff;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.label-with-tip {
    display: inline-flex;
    /* label text + ? in one line */
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    /* no wrap */
    min-width: 140px;
    /* width for label column */
}

.form-row>input {
    flex: 1 1 auto;
    min-width: 0;
}

.tooltip-container {
    position: relative;
    display: inline-flex;
}

.tooltip-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background-color: #999;
    border-radius: 50%;
    margin-left: 4px;
    transition: background-color 0.2s;
}

.tooltip-icon:hover {
    background-color: #666;
}

/* Tooltip text box */
.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.5;
    width: max-content;
    max-width: 260px;
    text-align: left;
    z-index: 999;
    transition: all 0.25s ease;
    white-space: normal;
}

/* Tooltip arrow */
.tooltip-text::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(40, 40, 40, 0.95) transparent;
}

/* Tooltip visible on hover */
.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    top: calc(100% + 12px);
}