/* ===== GLOBAL STYLES ===== */
html {
    height: 100%;
    min-height: 100%;
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    box-sizing: border-box;
    /* Hide scrollbars but allow scrolling */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;
}

/* Hide scrollbar for WebKit browsers */
body::-webkit-scrollbar {
    display: none;
}

/* Ensure background covers full document height */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../images/background.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* ===== HOMEPAGE STYLES ===== */
#home-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
}

#home-page .main-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#home-page .main-column > * {
    margin-bottom: 1em;
}

#home-page .genericdiv {
    position: absolute;
    top: env(safe-area-inset-top);
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 100%;
    display: inline;
    margin: 0 auto;
    justify-content: center;
}

#home-page #settings {
    display: block;
    margin-top: env(safe-area-inset-top)
}

#home-page .panel-column {
    align-self: stretch;
    background-color: #f2f2f2;
    border-radius: 5px;
    margin-top: 1em;
    justify-content: center;
}

#home-page .title {
    margin: 2em 3em 1em 3em;
    text-transform: uppercase;
    text-align: center;
    font-size: xx-large;
    font-weight: bold;
    letter-spacing: 2px;
    color: #000000;
}

#home-page button {
    cursor: pointer;
    color: #035306;
    background-color: rgba(255, 255, 255, 1);
    border: 1px solid #035306;
    border-radius: 4px;
    font-weight: 600;
    font-size: medium;
    margin: 15px 10px;
    width: 45%;
    padding: 15px;
    box-shadow: 0 0 20px #035306;
    transition: 0.4s;
}

#home-page button:hover {
    color: white;
    box-shadow: 0 0 20px #035306;
    background-color: #035306;
}

#home-page .display {
    display: none;
    margin-top: env(safe-area-inset-top);
}

#home-page .column {
    padding: 1.5em;
    align-self: stretch;
    background-color: #f2f2f2;
    border-radius: 5px;
    margin-top: 1em;
}

#home-page .column > * {
    margin: 15px;
}

#home-page #start:disabled:hover::before {
    content: "Please log in before starting test";
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    color: #035306;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 1;
    border: #035306;
}

/* Progress bar styling for home page */
#home-page #test-progress {
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
}

#home-page #test-progress::-webkit-progress-bar {
    background-color: #f0f0f0;
}

#home-page #test-progress::-webkit-progress-value {
    background-color: #035306;
}

#home-page #test-progress::-moz-progress-bar {
    background-color: #035306;
}

#home-page #status-message {
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

#home-page .run-all-btn {
    background-color: #035306;
    color: white;
    font-weight: bold;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

#home-page .run-all-btn:hover:not(:disabled) {
    background-color: #046b08;
}

#home-page .run-all-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

.loader {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loader div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 8px solid #fff;
    border-radius: 50%;
    animation: loader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #035306 transparent transparent transparent;
}

.loader div:nth-child(1) {
    animation-delay: -0.45s;
}

.loader div:nth-child(2) {
    animation-delay: -0.3s;
}

.loader div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loader {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#results-table {
    margin: 15px;
    border-collapse: collapse;
}

#results-table th {
    text-align: center;
    padding: .5em;
    background-color: #b3cbb4;
}

#results-table td {
    border: 1px solid #b3cbb4;
    padding: .5em;
    font-size: smaller;
}
.link {
    font-size: 12px;
}

#links {
    margin-bottom: 8px;
    margin-top: 25px;
    justify-content: space-evenly
}

.eula-content {
    background-color: #696969;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    color: #E8E8E8;
    max-width: 600px;
    width: 90%;
}

.eula-content p {
    font-size: 1em;
    margin: 2px;
}

.eula-content a {
    color: #76B900;
    text-decoration: none;
    font-weight: bold;
}

.eula-content a:hover {
    text-decoration: underline;
}

.eula-content button {
    color: #E8E8E8;
    background-color: #696969;
    box-shadow: none;
    border: none;
    padding: 5px;
    width: auto;
    margin: 2px;
}

.eula-content button:hover {
background-color: #828282;
}

.checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox input[type=checkbox] {
    height: 0;
    width: 0;
}

.checkbox label {
    --size: 50px;
    cursor: pointer;
    width: var(--size);
    height: calc(var(--size) / 2);
    background: grey;
    display: block;
    border-radius: 100px;
    position: relative;
}

.checkbox label:after {
    content: '';
    position: absolute;
    top: 6%;
    left: 2.5%;
    width: calc(50% - 5%);
    height: calc(100% - 11%);
    background: #fff;
    border-radius: 90px;
    transition: 0.3s;
}

.checkbox input:checked+label {
    background: #76B900;
}

.checkbox input:checked+label:after {
    left: calc(100% - 2.5%);
    transform: translateX(-100%);
}

.checkbox label:active:after {
    width: 55%;
}

.text {
    padding-left: 10px;
    color: #035306;
    font-weight: bold;
    font-style: italic;
}

.custom-select {
    position: relative;
    display: block;
    border: 1px solid #035306;
    background-color: rgb(205, 205, 205);
    color: #035306;
}

.label {
    padding-left: 10px;
    padding-right: 10px;
    color: #035306;
}

#custom-settings-form {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 550px;
    gap: 15px;
    color: #035306;
}

#custom-box:disabled:hover::before {
    content: "Please log in before configuring settings";
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    color: #035306;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 1;
    border: #035306;
    z-index: 1;
}

/* Test Results Styling */
#test-output {
    padding: 20px;
    overflow-y: auto;
    max-height: 70vh;
}

/* Style the test harness output */
#output {
    background-color: white;
    color: black;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: left;
    font-family: monospace;
    font-size: 14px;
    overflow-x: auto;
}

/* Style for test results */
.summary {
    font-weight: bold;
    margin: 10px 0;
    font-size: 18px;
    color: #333;
}

table.results {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background-color: white;
}

table.results th {
    background-color: #035306;
    color: white;
    text-align: left;
    padding: 10px;
}

table.results td {
    padding: 8px;
    border: 1px solid #ddd;
}

table.results tr.pass {
    background-color: rgba(3, 83, 6, 0.2);
}

table.results tr.fail {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Override the default test harness styles */
.pass {
    color: #035306 !important;
    font-weight: bold;
}

.fail {
    color: #dc3545 !important;
    font-weight: bold;
}

.error {
    color: #dc3545 !important;
}

.timeout {
    color: #fd7e14 !important;
}

.notrun {
    color: #6c757d !important;
}

/* Style for log messages */
#instructions {
    background-color: white;
    color: #333;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: left;
    white-space: pre-wrap;
}

#details {
    margin: 15px;
    text-align: left;
}

#details p {
    margin: 8px 0;
}

/* Collapsible section styles */
.collapsible-header {
    cursor: pointer;
    padding: 10px;
    width: 100%;
    text-align: left;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    color: #035306;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    border-radius: 4px 4px 0 0;
}

.collapsible-header:hover {
    background-color: rgba(3, 83, 6, 0.05);
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    width: 100%;
}

.collapsible-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

/* Modify the system-info h3 to work with collapsible header */
.system-info h3 {
    margin-top: 0;
    color: #035306;
    font-size: 1.1em;
    margin-bottom: 0;
    border-bottom: none;
    padding: 0;
    width: 100%;
}

.system-info .collapsible-header {
    border-radius: 4px 4px 0 0;
    width: 100%;
}

/* Custom test controls */
.test-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

/* Modify the test-controls-header to work as a collapsible header */
.test-controls-header {
    font-weight: bold;
    margin-bottom: 0;
    align-self: flex-start;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Optional test toggle */
.optional-test {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding: 5px;
    border-radius: 4px;
    align-self: flex-start;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.optional-test:hover {
    background-color: #e9ecef;
}

.optional-test-label {
    font-weight: normal;
    margin-left: 8px;
    cursor: pointer;
    flex: 1;
}

.optional-test input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.run-button {
    background-color: white;
    color: #035306;
    border: 2px solid #035306;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 15px;
    transition: background-color 0.3s, color 0.3s;
    min-width: 180px;
    text-align: center;
    box-shadow: none;
}

.run-button:hover {
    background-color: #035306;
    color: white;
}

.run-button:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

.status-text {
    margin-top: 10px;
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    width: 100%;
}

/* ===== API TEST PAGE STYLES ===== */
#api-test-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
}

#api-test-page .main-column {
    max-width: 1400px;
    width: 98%;
    padding: 16px;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Background pane for better contrast and readability */
#api-test-page .background-pane {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
    margin: 4px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Content container with better structure */
#api-test-page .content-layout {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

/* Header section */
#api-test-page .header-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    position: relative;
    padding: 4px 0;
    min-height: 60px;
}

#api-test-page .title {
    color: #000000;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    text-transform: none;
    padding: 0;
    letter-spacing: 0.5px;
}

/* GFN Logo removed from API page */

/* Two-pane grid layout */
#api-test-page .two-pane-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Pane styling */
#api-test-page .pane {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 215, 230, 0.4);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    min-width: 0;
    width: 100%;
}

#api-test-page .pane-header {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.15));
    padding: 12px 16px;
    font-weight: bold;
    font-size: 0.95em;
    color: #2c3e50;
    border-bottom: 1px solid rgba(200, 215, 230, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

#api-test-page .pane-content {
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

/* System info styling for API test page */
#api-test-page .system-info {
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

#api-test-page .system-info-row {
    display: flex;
    margin-bottom: 10px;
    align-items: baseline;
    line-height: 1.5;
}

#api-test-page .system-info-label {
    font-weight: bold;
    min-width: 220px;
    color: #555;
    padding-right: 12px;
}

#api-test-page .system-info-value {
    font-family: monospace;
    word-break: break-word;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 0.95em;
    flex: 1;
}

/* Test results styling for API test page */
#api-test-page #custom-results {
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

#api-test-page .test-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    table-layout: fixed;
    word-wrap: break-word;
}

#api-test-page .test-table th,
#api-test-page .test-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
}

#api-test-page .test-table th {
    background-color: #f2f2f2;
    text-align: left;
    font-weight: bold;
}

#api-test-page .test-result {
    display: flex;
    align-items: center;
}

#api-test-page .test-pass {
    color: #28a745;
    font-weight: bold;
}

#api-test-page .test-fail {
    color: #dc3545;
    font-weight: bold;
}

#api-test-page .test-optional {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
    margin-left: 8px;
}

#api-test-page .test-skipped {
    color: #6c757d;
    font-weight: normal;
    font-style: italic;
}

#api-test-page .summary {
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
}

/* Spinner for test progress */
#api-test-page .spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #035306;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Action buttons section */
#api-test-page .actions-section {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#api-test-page .actions-section .button-container {
    display: inline-block;
    margin: 0 8px;
}

#api-test-page .button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
}

#api-test-page button#download-api-results {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #035306;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: medium;
    margin: 15px 10px;
}

#api-test-page button#download-api-results:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

#api-test-page button#download-api-results:hover:not(:disabled) {
    background-color: #04701b;
}

#api-test-page button#api-home-button {
    cursor: pointer;
    color: #035306;
    background-color: rgba(255, 255, 255, 1);
    border: 1px solid #035306;
    border-radius: 4px;
    font-weight: 600;
    font-size: medium;
    margin: 15px 10px;
    padding: 8px 16px;
    transition: 0.4s;
}

#api-test-page button#api-home-button:hover {
    color: white;
    background-color: #035306;
}

/* Responsive design for API test page */
@media (max-width: 1024px) {
    #api-test-page .main-column {
        max-width: 100%;
        padding: 16px;
    }

    #api-test-page .background-pane {
        padding: 16px;
        margin: 8px 0;
        border-radius: 10px;
    }

    #api-test-page .two-pane-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #api-test-page .pane-content {
        max-height: none;
    }
}

@media (max-width: 768px) {
    #api-test-page .main-column {
        padding: 12px;
    }

    #api-test-page .background-pane {
        padding: 16px;
        margin: 8px 0;
        border-radius: 8px;
        backdrop-filter: blur(5px);
    }

    #api-test-page .content-layout {
        gap: 12px;
    }

    #api-test-page .two-pane-grid {
        gap: 12px;
        margin: 8px 0;
    }

    #api-test-page .pane {
        border-radius: 6px;
    }

    #api-test-page .pane-header {
        padding: 12px 16px;
        font-size: 1em;
    }

    #api-test-page .pane-content {
        padding: 16px;
    }

    #api-test-page .system-info-row {
        flex-direction: column;
    }

    #api-test-page .system-info-label {
        margin-bottom: 4px;
    }

    #api-test-page .system-info-value {
        padding-left: 8px;
    }
}

/* ===== INTERACTIVE GAMEPAD TEST PAGE STYLES ===== */
#interactive-gamepad-test-page {
    margin: 0;
    padding: 2em;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* When test results are shown, switch to normal flow */
#interactive-gamepad-test-page.has-results {
    display: block;
    padding: 2em;
    min-height: 100vh;
}

#interactive-gamepad-test-page .main-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Gamepad page logo - smaller size */
#interactive-gamepad-test-page .gfn-logo {
    width: 120px;  /* Smaller than default */
    height: auto;
    margin-bottom: 10px;
}

#interactive-gamepad-test-page .title {
    color: #000000;
    font-size: 1.5em;  /* Reduced from 1.8em */
    font-weight: bold;
    margin-bottom: 12px;  /* Reduced from 15px */
    text-transform: none;
    padding-bottom: 6px;  /* Reduced from 8px */
    letter-spacing: 0.3px;  /* Reduced from 0.5px */
}

/* Gamepad info section */
#interactive-gamepad-test-page .gamepad-info {
    background-color: white;
    color: #333;
    padding: 10px;        /* Reduced from 15px */
    border-radius: 4px;   /* Reduced from 5px */
    margin: 0 0 10px 0;   /* Reduced from 15px */
    text-align: left;
    border: 1px solid #dee2e6;
    font-family: sans-serif;
    font-size: 0.9em;     /* Smaller text */
    width: 100%;
    box-sizing: border-box;
}

#interactive-gamepad-test-page .gamepad-count {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;               /* Reduced from 10px */
    margin: 12px 0;         /* Reduced from 15px */
    padding: 8px;           /* Reduced from 10px */
    background-color: #f8f9fa;
    border-radius: 4px;     /* Reduced from 5px */
    border: 1px solid #dee2e6;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9em;       /* Smaller text */
}

#interactive-gamepad-test-page .gamepad-count input {
    width: 60px;
    padding: 5px;
    border: 1px solid #035306;
    border-radius: 4px;
}

/* Gamepad controls section */
#interactive-gamepad-test-page #gamepad-controls {
    padding: 15px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Gamepad results section */
#interactive-gamepad-test-page #gamepad-output {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
}

/* Custom test results display for gamepad */
#interactive-gamepad-test-page #custom-results {
    background-color: white;
    color: black;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: left;
    font-family: sans-serif;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
}

#interactive-gamepad-test-page .test-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: fixed;
}

#interactive-gamepad-test-page .test-table th,
#interactive-gamepad-test-page .test-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#interactive-gamepad-test-page .test-table th {
    background-color: #f2f2f2;
    text-align: left;
    font-weight: bold;
}

#interactive-gamepad-test-page .test-pass {
    color: #28a745;
    font-weight: bold;
}

#interactive-gamepad-test-page .test-fail {
    color: #dc3545;
    font-weight: bold;
}

#interactive-gamepad-test-page .summary {
    margin-top: 15px;
    font-weight: bold;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

/* Progress container for gamepad test */
#interactive-gamepad-test-page .progress-container {
    text-align: center !important;
    margin: 20px 0 !important;
    padding: 15px !important;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 5px !important;
}

/* Gamepad Status Box */
#interactive-gamepad-test-page #gamepad-status-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    max-width: 100%;
    box-sizing: border-box;
}

#interactive-gamepad-test-page #gamepad-status-box h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

#interactive-gamepad-test-page #gamepad-status-content {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    min-height: 60px;
    max-height: 250px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

/* Manual Gamepad Button Container */
#interactive-gamepad-test-page .gamepad-button-container {
    text-align: center;
    margin: 15px 0;  /* Reduced from 20px */
    width: 100%;
}

#interactive-gamepad-test-page #manual-gamepad-button {
    background-color: #cccccc;
    color: #666666;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: not-allowed;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
    width: auto !important;
    max-width: none !important;
}

#interactive-gamepad-test-page #manual-gamepad-button:not(:disabled) {
    background-color: #035306;
    color: white;
    cursor: pointer;
    opacity: 1;
}

#interactive-gamepad-test-page #manual-gamepad-button:not(:disabled):hover {
    background-color: #04701b;
}

#interactive-gamepad-test-page .button-description {
    font-size: 12px;  /* Reduced from 14px */
    color: #666;
    margin: 8px 0;    /* Reduced from 10px */
    text-align: center;
}

/* Gamepad buttons */
#interactive-gamepad-test-page button#download {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #035306;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: medium;
    margin: 15px 10px;
}

#interactive-gamepad-test-page button#download:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

#interactive-gamepad-test-page button#download:hover:not(:disabled) {
    background-color: #04701b;
}

#interactive-gamepad-test-page button#gamepad-home-button {
    cursor: pointer;
    color: #035306;
    background-color: rgba(255, 255, 255, 1);
    border: 1px solid #035306;
    border-radius: 4px;
    font-weight: 600;
    font-size: medium;
    margin: 15px 10px;
    padding: 8px 16px;
    transition: 0.4s;
}

#interactive-gamepad-test-page button#gamepad-home-button:hover {
    color: white;
    background-color: #035306;
}

#interactive-gamepad-test-page .button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
}

/* Panel content for gamepad test */
#interactive-gamepad-test-page .panel-column {
    max-width: 100%;
    box-sizing: border-box;
    padding: 15px;
    overflow-x: hidden;
    align-self: stretch;
    background-color: #f2f2f2;
    border-radius: 5px;
    margin-top: 1em;
    justify-content: center;
}

/* Collapsible content for gamepad test */
#interactive-gamepad-test-page .collapsible-content {
    overflow-x: auto;
    max-width: 100%;
}

#interactive-gamepad-test-page .collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #035306;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

#interactive-gamepad-test-page .collapsible-header:hover {
    background-color: rgba(3, 83, 6, 0.05);
}

#interactive-gamepad-test-page .toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s;
    color: #035306;
}

#interactive-gamepad-test-page .toggle-icon.collapsed {
    transform: rotate(-90deg);
}

/* Instructions styling for gamepad test */
#interactive-gamepad-test-page #instructions {
    background-color: white;
    color: black;
    padding: 0;
    border-radius: 5px;
    white-space: pre-wrap;
    text-align: left;
    margin: 0;
    min-height: 0;
    height: 0;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
}

/* Responsive design for gamepad test page */
@media (max-width: 1024px) {
    #interactive-gamepad-test-page .main-column {
        max-width: 100%;
        padding: 16px;
    }

    #interactive-gamepad-test-page .background-pane {
        padding: 16px;
        margin: 8px 0;
        border-radius: 10px;
    }

    #interactive-gamepad-test-page .two-pane-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #interactive-gamepad-test-page .pane-content {
        max-height: none;
    }
}

@media (max-width: 768px) {
    #interactive-gamepad-test-page .main-column {
        padding: 12px;
    }

    #interactive-gamepad-test-page .background-pane {
        padding: 16px;
        margin: 8px 0;
        border-radius: 8px;
        backdrop-filter: blur(5px);
    }

    #interactive-gamepad-test-page .content-layout {
        gap: 12px;
    }

    #interactive-gamepad-test-page .two-pane-grid {
        gap: 12px;
        margin: 8px 0;
    }

    #interactive-gamepad-test-page .pane {
        border-radius: 6px;
    }

    #interactive-gamepad-test-page .pane-header {
        padding: 12px 16px;
        font-size: 1em;
    }

    #interactive-gamepad-test-page .pane-content {
        padding: 16px;
    }
    
    #interactive-gamepad-test-page .gamepad-count {
        flex-direction: column;
        gap: 5px;
    }
}