body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f6f9fc;
    color: #222;
}

header {
    background: #35424a;
    color: #ffffff;
    padding: 10px 0;
    text-align: center;
}

nav {
    background: #35424a;
    padding: 15px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px 15px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background 0.3s;
}

nav a:hover {
    background: #2c3e50;
}

.container {
    width: 80%;
    margin: 20px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e3e8ee;
    padding: 32px 0 0 0;
    min-height: 100vh;
    box-shadow: 1px 0 0 0 #e3e8ee;
}
.sidebar h2 {
    font-size: 1.1em;
    margin: 0 0 24px 32px;
    letter-spacing: 1px;
    color: #1a1f71;
    font-weight: 600;
}

/* API Section Selection */
.api-config-section {
    margin-bottom: 32px;
    padding: 0 32px;
}

.api-config-section h3 {
    font-size: 1.0em;
    margin: 0 0 16px 0;
    letter-spacing: 1px;
    color: #1a1f71;
    font-weight: 600;
}

.api-group .radio-option {
    margin-bottom: 8px;
}

.api-group .radio-option label {
    padding: 12px 16px;
    border-radius: 6px;
}

.api-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-name {
    font-weight: 600;
    font-size: 1.05em;
    color: #1a1f71;
}

.api-desc {
    font-size: 0.85em;
    color: #6b7280;
    font-weight: 400;
}

.radio-option input[type="radio"]:checked + label .api-name {
    color: #1a1f71;
}

.radio-option input[type="radio"]:checked + label .api-desc {
    color: #6b7280;
}

.main-content {
    flex: 1;
    padding: 48px 48px 48px 48px;
    background: #f6f9fc;
    min-height: 100vh;
}
.main-content h1 {
    font-size: 2.1em;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1f71;
}
.tabs {
    display: flex;
    margin-bottom: 0;
    border-bottom: 1px solid #e3e8ee;
}
.tab-button {
    background: none;
    color: #1a1f71;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 32px 10px 32px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: color 0.2s, border-color 0.2s;
}
.tab-button.active {
    color: #f7b600;
    border-bottom: 2px solid #f7b600;
    background: #fff;
}
.tab-contents {
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0 0 8px 8px;
    padding: 0 0 24px 0;
    margin-bottom: 32px;
    box-shadow: 0 1px 2px rgba(50,50,93,0.03);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal overflow */
    box-sizing: border-box; /* Include padding in width calculation */
}
.tab-content {
    display: none;
    padding: 32px 40px 0 40px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
}
.tab-content.active {
    display: block;
    width: 100%;
}
#requestPayload, #responsePayload, #enrollRequestPayload, #enrollResponsePayload, #validateRequestPayload, #validateResponsePayload {
    background: #f6f8fa;
    border-radius: 6px;
    padding: 18px;
    font-size: 1.05em;
    min-height: 120px;
    max-height: 350px;
    width: 90%; /* Set width to 90% of the tab-content container */
    max-width: calc(100% - 80px); /* Account for side paddings in tab-content */
    margin: 0 auto; /* Center the pre element */
    overflow-x: auto;
    border: 1px solid #e3e8ee;
    color: #2d3748;
    font-family: 'JetBrains Mono', 'Fira Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    box-shadow: 0 2px 8px rgba(26, 31, 113, 0.08);
    box-sizing: border-box; /* Include padding in the width calculation */
    white-space: pre-wrap; /* Allow text wrapping in pre elements */
}

.validate-button-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left-justify content */
    width: 100%;
}

.validate-success-alert {
    width: 100%;
    max-width: 90%; /* Match browser width constraint */
}

.frictionless-info-alert {
    width: 100%;
    max-width: 90%;
    margin-top: 1rem;
}

/* Restart button styling */
#restart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    font-size: 1.15em;
    padding: 14px 24px; /* Add horizontal padding for better icon spacing */
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

#restart-button:hover:not(:disabled) {
    background: linear-gradient(90deg, #0074cd 0%, #1a1f71 100%);
    box-shadow: 0 4px 16px rgba(26,31,113,0.13);
}

#restart-button:disabled {
    background: #dbeafe;
    cursor: not-allowed;
}

#restart-button .button-text {
    display: inline-flex;
    align-items: center;
}
#setup-button {
    min-width: 200px;
    font-size: 1.15em;
    padding: 14px 0;
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: button-spin 1s linear infinite;
}

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

.device-data-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    border: 1px solid #e3e8ee;
}

.status-bar {
    width: 120px;
    height: 6px;
    background: #e3e8ee;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.status-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    animation: status-progress 2s ease-in-out infinite;
}

@keyframes status-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.status-text {
    color: #1a1f71;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
}
#setup-button:disabled {
    background: #dbeafe;
    cursor: not-allowed;
}
#setup-button:hover:not(:disabled) {
    background: linear-gradient(90deg, #0074cd 0%, #1a1f71 100%);
    box-shadow: 0 4px 16px rgba(26,31,113,0.13);
}

#enroll-button {
    min-width: 200px;
    font-size: 1.15em;
    padding: 14px 0;
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#enroll-button:disabled {
    background: #dbeafe;
    cursor: not-allowed;
}

#enroll-button:hover:not(:disabled) {
    background: linear-gradient(90deg, #0074cd 0%, #1a1f71 100%);
    box-shadow: 0 4px 16px rgba(26,31,113,0.13);
}

#validate-button {
    min-width: 200px;
    font-size: 1.15em;
    padding: 14px 0;
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#validate-button:disabled {
    background: #dbeafe;
    cursor: not-allowed;
}

#validate-button:hover:not(:disabled) {
    background: linear-gradient(90deg, #0074cd 0%, #1a1f71 100%);
    box-shadow: 0 4px 16px rgba(26,31,113,0.13);
}

.extracted-values {
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    margin: 32px 0 0 0;
    padding: 28px 40px 24px 40px;
    box-shadow: 0 1px 2px rgba(50,50,93,0.03);
}
.extracted-section h3 {
    margin-top: 0;
    color: #1a1f71;
    font-size: 1.18em;
    font-weight: 700;
    margin-bottom: 18px;
}
.extracted-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.extracted-label {
    min-width: 220px;
    color: #6b7c93;
    font-weight: 500;
    font-size: 1.04em;
}
.extracted-value {
    color: #1a1f71;
    font-family: 'JetBrains Mono', 'Fira Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 1.04em;
    word-break: break-all;
}
.extracted-value a {
    color: #0074cd;
    text-decoration: underline;
}
.ddc-spinner-wrap {
    width: 340px;
    height: 48px;
    background: #fff;
    border-radius: 8px;
    margin: 0 0 32px 0;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px;
    gap: 18px;
}
.ddc-spinner {
    width: 28px;
    height: 28px;
    border: 4px solid #e3e8ee;
    border-top: 4px solid #1a1f71;
    border-radius: 50%;
    animation: ddc-spin 1s linear infinite;
    margin-right: 0;
    transition: border-top-color 0.3s;
}
.ddc-spinner.done {
    border-top: 4px solid #00b67a;
    animation: none;
}
@keyframes ddc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ddc-spinner-label {
    color: #1a1f71;
    font-weight: 600;
    font-size: 1.08em;
}
.device-data-collection-area {
    display: inline-flex;
    align-items: center;
    margin-left: 24px;
    min-width: 340px;
    vertical-align: middle;
}
.ddc-bar-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    padding: 0 18px;
    min-width: 260px;
    height: 48px;
}
.ddc-bar {
    position: relative;
    width: 120px;
    height: 8px;
    background: #e3e8ee;
    border-radius: 4px;
    overflow: hidden;
}
.ddc-bar-inner {
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    border-radius: 4px;
    transition: background 0.3s;
    will-change: left;
}
.ddc-bar-label {
    color: #1a1f71;
    font-weight: 600;
    font-size: 1.08em;
    margin-left: 12px;
}
.setup-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Align items to the start for consistent positioning */
    gap: 1rem;
    width: 100%;
    margin-top: 32px;
    max-width: 90%; /* Match the max-width of pre elements */
}

#setup-button {
    flex-shrink: 0;
}

.api-section {
    display: none;
}

.api-section.active {
    display: block;
}

.card-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.current-card {
    padding: 12px 16px;
    background: #f8f9fc;
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    font-size: 0.85em;
}

.card-label {
    font-weight: 600;
    color: #1a1f71;
    margin-right: 8px;
}

/* Radio Button Groups */
.config-group {
    margin-bottom: 20px;
}

.config-group h4 {
    margin: 0 0 12px 0;
    color: #1a1f71;
    font-size: 0.95em;
    font-weight: 600;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e3e8ee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.radio-option label:hover {
    border-color: #f7b600;
    background: #fefbf3;
}

.radio-option input[type="radio"]:checked + label {
    border-color: #1a1f71;
    background: #f8f9fc;
    box-shadow: 0 0 0 1px #1a1f71;
}

/* Font Awesome Brand Icon Styles */
.brand-icon {
    font-size: 1.4em;
    margin-right: 8px;
    width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.visa-icon {
    color: #1a1f3a;
}

.mastercard-icon {
    color: #eb001b;
}

/* Enhanced hover effects for brand icons */
.radio-option:hover .visa-icon {
    color: #003d82;
    transform: scale(1.05);
}

.radio-option:hover .mastercard-icon {
    color: #ff5f00;
    transform: scale(1.05);
}

.radio-option input[type="radio"]:checked + label .visa-icon {
    color: #003d82;
}

.radio-option input[type="radio"]:checked + label .mastercard-icon {
    color: #ff5f00;
}

/* Font Awesome Brand Icon Styles */
.brand-icon {
    font-size: 1.4em;
    margin-right: 8px;
    width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.visa-icon {
    color: #1a1f3a;
}

.mastercard-icon {
    color: #eb001b;
}

/* Enhanced hover effects for brand icons */
.radio-option:hover .visa-icon {
    color: #003d82;
    transform: scale(1.05);
}

.radio-option:hover .mastercard-icon {
    color: #ff5f00;
    transform: scale(1.05);
}

.radio-option input[type="radio"]:checked + label .visa-icon {
    color: #003d82;
}

.radio-option input[type="radio"]:checked + label .mastercard-icon {
    color: #ff5f00;
}

/* Enhanced radio button hover effects */
.radio-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Inline Card Configuration Styles */
.inline-card-config {
    background: #f8f9fc;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    display: none; /* Hidden by default, shown only on request tab */
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.inline-card-config.visible {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.inline-config-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.inline-config-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inline-config-label {
    font-size: 0.95em;
    font-weight: 600;
    color: #1a1f71;
    margin: 0;
}

.inline-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.inline-radio-option {
    position: relative;
}

.inline-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.inline-radio-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #e3e8ee;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    font-size: 0.9em;
    font-weight: 500;
    color: #374151;
    min-width: fit-content;
    white-space: nowrap;
}

.inline-radio-option label:hover {
    border-color: #f7b600;
    box-shadow: 0 4px 12px rgba(26, 31, 113, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.inline-radio-option input[type="radio"]:checked + label {
    background: #fff;
    border-color: #f7b600;
    color: #1a1f71;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(247, 182, 0, 0.2);
}

.inline-radio-option .brand-icon {
    font-size: 1.2em;
    color: #9ca3af;
    transition: color 0.25s ease, transform 0.2s ease;
}

/* Enhance icons on hover */
.inline-radio-option:hover .brand-icon.visa-icon {
    color: #1a1f71;
}

.inline-radio-option:hover .brand-icon.mastercard-icon {
    color: #ff5f00;
}

.inline-radio-option input[type="radio"]:checked + label .brand-icon.visa-icon {
    color: #003d82;
    transform: scale(1.05);
}

.inline-radio-option input[type="radio"]:checked + label .brand-icon.mastercard-icon {
    color: #ff5f00;
    transform: scale(1.05);
}

.inline-radio-option .flow-name {
    font-size: 0.9em;
    transition: transform 0.2s ease;
}

.inline-radio-option:hover .flow-name {
    transform: translateY(-1px);
}

.inline-radio-option input[type="radio"]:checked + label .flow-name {
    font-weight: 600;
}

/* Responsive adjustments for inline config */
@media (max-width: 768px) {
    .inline-config-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .inline-radio-group {
        gap: 12px;
    }
    
    .inline-radio-option label {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* Restart Button styling to match other action buttons */
#restart-button {
    min-width: 200px;
    font-size: 1.15em;
    padding: 14px 20px;
    background: linear-gradient(90deg, #1a1f71 0%, #0074cd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left-justify button content */
    gap: 8px;
    text-align: left; /* Left-align text */
    margin-top: 10px; /* Add some space between alert and button */
}

#restart-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#restart-button:hover:not(:disabled) {
    background: linear-gradient(90deg, #1a1f71 0%, #0098ff 100%);
    box-shadow: 0 4px 12px rgba(26,31,113,0.15);
}

/* Validate button container styling */
.validate-button-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left-justify content */
    width: 100%;
}

.validate-success-alert {
    width: 100%;
    max-width: 90%; /* Match browser width constraint */
}