.va2gcu-cw-container {
    padding: 5px !important;
    margin: 10px 0;
}

.va2gcu-cw-container h2 {
    margin-bottom: 2px !important;
}

.main-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}  

.control-section {
    display: flex;
    flex-direction: row;
    gap: 50px;
    align-items: flex-start;
    width: fit-content;
}

/* Configuration Tab Styles */
.config-section {
    padding: 10px !important;
    margin: 0 !important;
    width: 100%;
}

.config-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.config-item {
    display: grid;
    grid-template-columns: 1fr 80px;
    align-items: center;
    gap: 20px;
    padding-left: 20px;
    padding-right: 20px;
}

.config-item label {
    white-space: nowrap;
    font-size: 15px;
    text-align: right;
}

.config-item input {
    width: 80px;
    padding: 1px;
    height: 25px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px !important;
}

.config-item.word-delay {
    grid-template-columns: 1fr 80px;
    margin-top: 10px;
}

.va2gcu-cw-exercise {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 3px !important;
    margin: 0 !important;
    width: fit-content;
}

.va2gcu-cw-exercise h3 {
    margin: 0 0 5px 0 !important;
    padding-bottom: 5px !important;
    border-bottom: 1px solid #ddd;
    font-size: 0.9em !important;
    font-weight: normal;
    text-align: center;
}

.letters-controls, .numbers-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 3px 8px !important;
}

.letters-type, .letters-order, .numbers-type, .numbers-order {
    display: flex;
    align-items: center;
    gap: 10px;
}

.letters-type label, .letters-order label,
.numbers-type label, .numbers-order label {
    white-space: nowrap;
    font-size: 15px;
}

.letters-type select, .letters-order select,
.numbers-type select, .numbers-order select,
.special-chars-order select, .mixing-order select {
    width: 120px;
    padding: 2px;
    height: 25px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
#mix-groups {
    width: 120px;
    padding: 2px;
    height: 25px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.total-chars-section {
    padding: 0 8px !important;
    margin-top: 10px !important;
}

.total-chars-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
}

.total-chars-controls label {
    white-space: nowrap;
    font-size: 15px;
}

.total-chars-controls input {
    width: 60px;
    padding: 1px;
    height: 25px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px !important;
    background-color: white;
}

.total-chars-controls input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.char-spacing-section {
    padding: 0 8px !important;
    margin-top: 10px !important;
}

.char-spacing-controls {
    display: flex;
    align-items: center;
    padding-left: 20px;
    width: 100%;
}

/* Standardized font sizes and styling for all labels and notes */
.char-spacing-controls label,
.chars-display-option label,
.chars-display-note,
.koch-exercise-select label,
.koch-display-option label,
.koch-display-note {
    font-size: 15px;
    font-family: inherit;
    font-weight: normal;
    color: #333;
/****** Eric */
    display: flex;
    align-items: center;
/***********/

}

.chars-display-note,
.koch-display-note {
    font-size: 15px;
    color: #666;
    font-style: italic;
    margin-left: 26px;
    max-width: 350px;  /* Control the width to force wrapping */
    line-height: 1.4;
    margin-top: 5px;
    white-space: normal;  /* Ensure text wraps */
}

.char-spacing-controls input[type="checkbox"],
.chars-display-option input[type="checkbox"],
.koch-display-option input[type="checkbox"] {
    margin-left: 10px !important;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.section-divider {
    margin: 4px 5px !important;
    border: none;
    border-top: 1px solid #ddd;
}

.special-chars-section {
    padding: 0 8px !important;
    margin-bottom: 3px !important;
}

.special-chars-section h4 {
    font-size: 15px !important;
    font-weight: normal;
    margin: 3px 0 5px 0 !important;
}

.special-chars-grid {
    display: flex;
    flex-direction: column;
    gap: 8px !important;
}

.special-char-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(40px, 1fr));
    gap: 20px;
    align-items: center;
    padding-left: 20px;
}

.special-char-row.cert-can {
    display: flex;
    gap: 20px;
}

.special-char-title {
    font-size: 14px;
    color: #666;
    min-width: 120px;
}

.special-char-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 40px;
    font-size: 15px;
}

.special-char-row input[type="checkbox"] {
    margin: 0;
}

.char-divider {
    margin: 3px 10px;
    border: none;
    border-top: 1px solid #ddd;
}

/* Koch select dropdown styling */
.koch-exercise-select select {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    height: 37px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}
/* Koch dropdown styles continued */
.koch-exercise-select select option {
    padding: 8px;
    font-size: 15px;
    height: 35px;
    line-height: 35px;
}

/* Edge specific styles */
@supports (-ms-ime-align: auto) {
    .koch-exercise-select select {
        padding-right: 30px;
    }
    
    .koch-exercise-select select:focus {
        max-height: 280px !important; /* Show exactly 8 items */
        overflow-y: auto;
    }
}

/* Chrome/Edge/Safari specific styles */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .koch-exercise-select select {
        background-position: right 8px center;
    }
    
    .koch-exercise-select select option {
        padding: 8px;
        height: 35px;
        line-height: 35px;
    }
    
    .koch-exercise-select select:focus {
        height: auto !important;
        max-height: 280px !important; /* 8 items × 35px */
    }
}

/* Firefox specific styles */
@-moz-document url-prefix() {
    .koch-exercise-select select {
        text-indent: 0;
    }
    
    .koch-exercise-select select:focus {
        height: auto !important;
        max-height: 280px !important;
    }
    
    .koch-exercise-select select option {
        height: 35px;
        line-height: 35px;
    }
}

/* Standard controls styling */
.special-chars-order {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px !important;
    padding-left: 20px;
}

.special-chars-order label {
    white-space: nowrap;
    font-size: 15px;
}

.mixing-divider {
    margin: 10px 5px 10px 5px !important;
    border: none;
    border-top: 3px solid #ddd;
}

.mixing-section {
    padding: 0 8px !important;
    margin-top: 5px !important;
}

.mixing-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
}

.mixing-controls label {
    white-space: nowrap;
    font-size: 15px;
    font-weight: bold;
}

.tab-container {
    margin-top: 3px !important;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
    gap: 5px;
}

.tab-button {
    padding: 6px 15px !important;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
}

.tab-button.active {
    border-bottom: 2px solid #4CAF50;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 8px 10px !important;
}

.tab-content.active {
    display: block;
}

/* Koch display options styling */
.koch-display-option {
    margin-top: 15px;
    padding-left: 20px;
}
.debug-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    margin-left: 0;
}

.debug-window {
    font-family: 'VT323', monospace;
    background-color: #000;
    color: #00ff00;
    border: 2px solid #666;
    border-radius: 15px;
    padding: 20px;
    width: calc(40ch + 40px) !important;
    height: calc(10em + 40px) !important;
    line-height: 0.8em !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-top: 0;
    font-size: 30px !important;
}

.debug-content {
    width: 40ch !important;
    height: 10em !important;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: pre;
    margin: 0;
    padding: 0;
    font-size: 30px !important;
}

.debug-content::-webkit-scrollbar {
    display: none;
}

.debug-cursor {
    display: inline-block;
    width: 0.5em;
    height: 0.8em;
    background-color: #00ff00;
    margin-left: 1px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Control Buttons Styles */
.control-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.control-btn {
    font-family: 'BlockLetters', Arial, sans-serif;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: background-color 0.3s;
}

.control-btn.play {
    background-color: #4CAF50;
}

.control-btn.play.inactive {
    background-color: #cccccc;
    cursor: not-allowed;
}

.control-btn.pause {
    background-color: #B8860B;
    color: black;
}

.control-btn.pause.active {
    background-color: #FFEB3B;
    color: black;
}

.control-btn.stop {
    background-color: #dc3545;
}

.debug-clear-btn {
    font-family: 'BlockLetters', Arial, sans-serif;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.debug-clear-btn:hover,
.control-btn:hover {
    filter: brightness(110%);
}

/* Help icon and popup styles */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #666;
    color: white;
    font-size: 14px;
    cursor: pointer;
    margin-left: 10px;
}
.help-icon:hover {
    background: #888;
}

.help-popup {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    padding: 0;
}

.help-popup-content {
    position: relative;
}

.popup-title-bar {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.help-popup h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
}

.help-popup ol {
    margin: 0;
    padding-left: 20px;
}

.help-popup li {
    font-size: 14px;
    margin-bottom: 5px;
}

.close-popup {
    cursor: pointer;
    font-size: 16px;
    color: #666;
    padding: 5px;
}

.popup-body {
    padding: 20px;
}

.popup-body ol {
    margin: 0;
    padding-left: 20px;
}

.popup-body li {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.close-popup:hover {
    color: #333;
}

.popup-note {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.popup-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #ddd;
}

.popup-close-btn {
    padding: 8px 20px;
    background-color: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.popup-close-btn:hover {
    background-color: #888;
}

.vintage-message {
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 30px !important;
    text-align: center;
    animation: scanline 2s linear infinite;
    padding: 20px;
    line-height: 1.2;
    opacity: 0.8;
}

@keyframes scanline {
    0% { opacity: 0.8; }
    50% { opacity: 0.9; }
    100% { opacity: 0.8; }
}

/* Fix for scrollbar in Koch select dropdown */
select#koch-select::-webkit-scrollbar {
    width: 8px;
}

select#koch-select::-webkit-scrollbar-track {
    background: #f0f0f0;
}

select#koch-select::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
    border: 2px solid #f0f0f0;
}

.chars-display-option {
    padding-left: 20px;  /* Match padding of other sections */
    margin-top: 10px;
}

/* Import font */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');