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;
    position: relative;
    padding-top: 60px; /* Space for the menu button */
    z-index: 1; /* Base layer */
}

/* Menu Toggle Button */
.menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1010; /* Match sidebar z-index */
    color: #1a1f71;
    font-size: 24px;
    cursor: pointer;
    padding: 12px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.menu-toggle i {
    font-size: 24px;
    line-height: 1;
}

/* When sidebar is open, hide menu toggle */
.sidebar:not(.closed) ~ .menu-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
}

.sidebar {
    position: fixed;
    width: 260px;
    height: 100vh;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1010; /* Higher than menu toggle */
    border-right: 1px solid #e3e8ee;
    padding: 32px 0 0 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    left: 0;
    top: 0;
}

.sidebar.closed {
    transform: translateX(-100%);
}

.sidebar:not(.closed) {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    background: #fff;
}

.menu-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #1a1f71;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-close:hover {
    transform: translateY(-50%) rotate(90deg);
}

.sidebar:not(.closed) .menu-close {
    transform: translateY(-50%) rotate(90deg);
}

.main-content {
    flex: 1;
    padding: 48px;
    background: #f6f9fc;
    min-height: 100vh;
    margin-left: 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

.main-content h1 {
    font-size: 2.1em;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1f71;
}
.tabs {
    width: 100%;
    display: flex;
    gap: 2px;
    margin: 0;
    border-bottom: 1px solid #e3e8ee;
    box-sizing: border-box;
}
.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 {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0 0 8px 8px;
    padding: 0 0 24px 0;
    box-shadow: 0 1px 2px rgba(50,50,93,0.03);
    box-sizing: border-box;
}

.api-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}
.tab-content {
    display: none; /* Hide by default */
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
}

.tab-content.active {
    display: block; /* Show when active */
}
/* Alert container styling */
.alert {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 1rem 0;
    border-radius: 6px;
}
.json-container {
    position: relative;
    width: 100%;
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9em;
    color: #1a1f71;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.copy-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.copy-button i {
    font-size: 0.9em;
}

#requestPayload, #responsePayload, #enrollRequestPayload, #enrollResponsePayload, #validateRequestPayload, #validateResponsePayload {
    background: #f6f8fa;
    border-radius: 6px;
    padding: 12px;
    padding-right: 40px; /* Make room for copy button */
    font-size: 1.05em;
    min-height: 120px;
    max-height: 350px;
    width: 100%;
    margin: 0;
    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;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* JSON Header Styling */
.json-header {
    margin: 0 0 12px 0;
    font-size: 0.85em;
    font-weight: 500;
    color: #6b7c93;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 2px;
}

.json-header i {
    font-size: 1em;
    opacity: 0.75;
}

.validate-button-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

/* Alert container styling */
.validate-button-container .alert,
.validate-button-container .validate-success-alert,
.validate-button-container .frictionless-info-alert {
    width: 100%;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: flex-start;
}

/* Success alert specific styles */
.validate-success-alert {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    margin-bottom: 1.5rem;
}

/* Info alert specific styles */
.frictionless-info-alert {
    background-color: #cce5ff;
    border-color: #b8daff;
    color: #004085;
}

/* 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: 14px 16px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(26,31,113,0.08);
    border: 1px solid #e3e8ee;
    min-width: 200px;
    height: 56px;
    box-sizing: border-box;
    font-size: 1.15em;
    line-height: 1.5;
}

.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;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
    padding: 2rem 5px 0;
}

#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; /* Hide by default */
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.inline-card-config.visible {
    display: block; /* Show when visible class is present */
}

@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);
}

/* Style rules for the menu toggle button */

/* Menu Toggle Button */
.menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1010; /* Match sidebar z-index */
    color: #1a1f71;
    font-size: 24px;
    cursor: pointer;
    padding: 12px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.menu-toggle i {
    font-size: 24px;
    line-height: 1;
}

/* When sidebar is open, hide menu toggle */
.sidebar:not(.closed) ~ .menu-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
}

.menu-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #1a1f71;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-close:hover {
    transform: translateY(-50%) rotate(90deg);
}

.sidebar:not(.closed) .menu-close {
    transform: translateY(-50%) rotate(90deg);
}