/* General styling for OBS overlay */
body {
    background-color: rgba(0, 0, 0, 0); /* Transparent background */
    color: #EFEFEF; /* Off-white text */
    font-family: 'Swiss 721 Bold Extended BT', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Hide scrollbars */
}

/* Container for the input history */
#input-container {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 300px;
    display: flex;
    flex-direction: column; /* Display newest on top, pushing down */
    align-items: flex-start;
    gap: 0px;
}

/* Styling for each input item */
.input-item {
    animation: fadeIn 0.15s ease-in-out;/* Apply the fade-in animation */
    width: 100%; /* Take up full width */
    display: flex;
    align-items: center; /* Changed from baseline to center */
    padding: 4px; 
    gap: var(--glyph-spacing, 4px); /* Add space between frame counter and input groups */
}

.input-glyph {
    flex: none; /* Don't grow/shrink */
    background-color: rgba(0, 0, 0, 1.0);
    border-radius: 50%; /* Make it a circle */
    width: var(--glyph-size, 40px);
    height: var(--glyph-size, 40px);
    display: flex;
    align-items: center;
    justify-content: center;    
}

.frame-count {
    margin-right: 8px;
    min-width: 50px;
    text-align: right;
    font-size: 0.7em; /* Adjust font size for better alignment */
    color: #EFEFEF; /* Ensure visibility */
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

.input-item svg {
    width: calc(var(--glyph-size, 40px) * 0.95);
    height: calc(var(--glyph-size, 40px) * 0.95);
    fill: #EFEFEF;    
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Special case for dash chevrons to make them look good in a circle */
.input-glyph svg[viewBox="0 0 32 32"] {
    width: calc(var(--glyph-size, 40px) * 0.95);
    height: calc(var(--glyph-size, 40px) * 0.95);
}

/* Status message for when no gamepad is connected */
#status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
}

/* Animation for input items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to { /* Stay fully visible */
        opacity: 1;
        transform: translateX(0);
    }
}

.input-separator {
    display: none;
}

/* --- Settings Panel --- */

#settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

#settings-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-content {
    background-color: #1c1c1c;
    padding: 15px 25px;
    border-radius: 10px;
    border: 1px solid #444;
    max-height: 80vh;
    min-width: 380px;
    overflow-y: auto;
    color: #EFEFEF;
    font-family: 'Roboto', sans-serif;
    font-weight: 600; /* Semibold */
}

.settings-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: left;
    text-transform: uppercase;
    font-size: 1em;
    color: #ccc;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}

.settings-content h2 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
}

.general-settings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 12px;
}

.general-setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.general-setting-item label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
}


.settings-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.settings-content hr {
    border: 0;
    border-top: 1px solid #444;
    margin: 20px 0;
    width: 100%;
}

.settings-grid {
    display: grid;
    grid-template-columns: auto 25px 1fr auto auto;
    gap: 10px 12px;
    align-items: center;
    margin-bottom: 15px;
}

.settings-grid .grid-header {
    color: #999;
    font-size: 0.8em;
    text-transform: uppercase;
    padding-bottom: 5px;
}

.settings-grid label {
    text-align: center;
    font-weight: 600; /* Semibold */
}

/* Unified style for all text and number inputs */
.settings-content input[type="text"], .settings-content input[type="number"] {
    background-color: #111;
    border: 1px solid #555;
    color: #EFEFEF;
    border-radius: 4px;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    height: 34px; /* Uniform height */
}

.settings-grid select {
    width: 100%;
}

.settings-grid select {
    background-color: #111;
    border: 1px solid #555;
    color: #EFEFEF;
    border-radius: 4px;
    padding: 5px;
}

.settings-description {
    font-size: 0.8em;
    text-align: center;
    color: #aaa;
    margin-top: 0;
    margin-bottom: 20px;
}

.color-controls-container {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 4; /* This container is in the 4th grid column */
}

.rgb-input-group {
    display: flex;
    gap: 4px;
}

.swatch-hex-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.labeled-input {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.labeled-input label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
}

.rgb-input {
    width: 45px; /* Uniform width for RGB inputs */
    -moz-appearance: textfield; /* Firefox */
}

/* Hide arrows on number inputs for a cleaner look */
.settings-content input[type="number"]::-webkit-outer-spin-button,
.settings-content input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hex-input {
    font-family: monospace;
    width: 70px; /* Uniform width for Hex input */
    text-align: center;
}


.color-input-swatch {
    width: 34px;
    height: 34px;
    border: 1px solid #555;
    border-radius: 4px;
    flex-shrink: 0;
}

.button-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-color-container {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align toggle to the left */
    gap: 8px;
}

.text-color-toggle {
    appearance: none;
    width: 40px;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.text-color-toggle:checked {
    background-color: #777;
}

.text-color-toggle::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #eee;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.text-color-toggle:checked::before {
    left: 22px;
}

.text-color-label {
    margin-left: 0;
}
.settings-footer {
    display: flex;
    justify-content: flex-start; /* Align button to the left */
    margin-top: 20px; /* Increase spacing */
}

#reset-settings-btn {
    background-color: #4a4a4a;
    border: 1px solid #666;
    color: #EFEFEF;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#reset-settings-btn:hover {
    background-color: #5a5a5a;
}



@font-face {
    font-family: 'Swiss 721 Bold Extended BT';
    src: url('https://raw.githubusercontent.com/chrisdejoya/Trailpad/main/fonts/Swiss%20721%20Bold%20Extended%20BT%20V2.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}