/* ---------- Table Styles ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    margin-bottom: 1rem;
}
th, td {
    border: 1px solid #999;
    padding: 8px;
    text-align: left;
}
th {
    background: #eee;
}
td[contenteditable="true"] {
    background: #fefcd4;
    cursor: text;
}
.category-row {
    background-color: #ddd;
    font-weight: bold;
    text-transform: uppercase;
}

/* ---------- Error Bubble ---------- */
.error-bubble {
    display: inline-block;
    background: #f44336;
    color: white;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    font-size: 12px;
    animation: fadeOut 5s forwards;
}
@keyframes fadeOut {
    0% {opacity: 1;}
    80% {opacity: 1;}
    100% {opacity: 0; display: none;}
}

/* ---------- Input Fields ---------- */
.input-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* responsive wrap on small screens */
}
.input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
}
.input-group label {
    margin-right: 6px;
    white-space: nowrap;
    font-size: 16px; /* slightly larger for tablet readability */
}

/* Make Name & Date input bigger for tablets */
#sig-name,
#sig-date {
    font-size: 18px;
    padding: 10px 12px;
    width: 200px;
    max-width: 100%;
    box-sizing: border-box;
}

/* ---------- Buttons ---------- */
.button-wrapper {
    text-align: center;
    margin-top: 20px;
}
.big-button {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    margin: 10px 5px;
    display: inline-block;
}
.big-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}
.clear-btn {
    background-color: #f44336;
}
.submit-btn {
    background-color: #4CAF50;
}

/* ---------- Responsive Adjustments ---------- */
@media screen and (max-width: 600px) {
    .big-button {
        width: 100%;
        max-width: 300px;
        display: block;
        margin: 10px auto;
    }

    /* Table scroll on small screens */
    table {
        display: block;
        overflow-x: auto;
    }

    /* Input fields full width */
    #sig-name,
    #sig-date {
        width: 100%;
    }

    .input-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* ---------- Signature Canvas ---------- */
#signature-pad {
    border: 1px solid #000;
    max-width: 100%;
    height: auto;
    touch-action: none; /* better touch drawing on tablet */
}
