* {
    box-sizing: border-box;
}

:root {
    /* Base unit uses rem so elements scale with font size */
    --unit: 3rem;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #000000; /* Change background color to black */
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

textarea,
input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

button:active {
    background-color: #004080;
}

.color-button {
    background-color: #0000FF; /* Start on blue to match JS */
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-button:hover {
    border: 2px solid #004080; /* Only change the border on hover */
    background-color: #0000FF;
}

.color-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Generic disabled style for buttons */
button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.camera-button {
    width: 100px;
    height: 100px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: white;
    background-color: #007BFF; /* Default color */
}

.camera-button:hover {
    border: 2px solid #004080; /* Only change the border on hover */
    background-color: #0056b3;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#textField {
    flex: 1;
    min-width: 200px;
    width: auto;
    resize: none;
    overflow-y: hidden;
    line-height: 1.2em;
}

.input-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.result-row {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 20px;
    flex-wrap: nowrap;
}

.qr-button {
    flex-shrink: 0;
}

#qrcode {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

#resultText {
    flex: 1;
    min-width: 200px;
    width: auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #e9e9e9;
    color: #333;
    overflow-wrap: break-word; /* Enable word wrap */
    white-space: pre-wrap;
    height: auto; /* Initial height */
    min-height: 100px; /* Minimum height */
    max-height: 200px; /* Limit growth to double the minimum */
    overflow-y: auto; /* Scroll when content exceeds max height */
}

.local-message {
    text-align: left;
}

.remote-message {
    text-align: right;
}

/* Unit size classes */
/* Horizontal unit classes */
[class^="h-"] {
    flex: 0 0 auto;
}

.h-1 { width: calc(var(--unit) * 1); }
.h-2 { width: calc(var(--unit) * 2); }
.h-3 { width: calc(var(--unit) * 3); }
.h-4 { width: calc(var(--unit) * 4); }
.h-5 { width: calc(var(--unit) * 5); }
.h-6 { width: calc(var(--unit) * 6); }
/* Extended unit sizes for larger elements */
.h-7 { width: calc(var(--unit) * 7); }
.h-8 { width: calc(var(--unit) * 8); }
.h-9 { width: calc(var(--unit) * 9); }
.h-10 { width: calc(var(--unit) * 10); }
.h-11 { width: calc(var(--unit) * 11); }
.h-12 { width: calc(var(--unit) * 12); }

/* Vertical unit classes */
.v-1 { height: calc(var(--unit) * 1); }
.v-2 { height: calc(var(--unit) * 2); }
.v-3 { height: calc(var(--unit) * 3); }
.v-4 { height: calc(var(--unit) * 4); }
.v-5 { height: calc(var(--unit) * 5); }
.v-6 { height: calc(var(--unit) * 6); }

.square {
    aspect-ratio: 1 / 1;
}

/* Invisible element that still consumes space */
.spacer {
    visibility: hidden;
    pointer-events: none;
}

.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    opacity: 0.9;
    z-index: 1000;
}
