/* Express Pay Widget Demo Styles
 * 
 * This file contains styles specific to the demo page.
 * It does NOT affect the widget itself - widget styles are in express-sdk.css
 */

/* Base demo page styles */
body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: #f8fafc;
}

/* Unified Header Styles */
h1 {
    color: #1e293b;
    margin: 0 0 3rem 0;
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.025em;
}

h2 {
    color: #1e293b;
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

h3 {
    color: #1e293b;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Widget Spacing */
express-pay-widget {
    display: block;
    margin: 0;
}

/* Demo controls section */
.demo-controls {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 0;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    word-wrap: break-word;
}

/* Configuration Header with Toggle */
.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s ease;
    border-radius: 24px;
    border: 2px solid #e5e7eb;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #0f172a;
    border-color: #0f172a;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

/* Configuration Views */
.config-view {
    transition: opacity 0.3s ease;
}

#config-data {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    margin: 0;
    border: 1px solid #e2e8f0;
    min-height: 200px;
    max-height: 300px;
    max-width: 100%;
}

/* Input group layout */
.input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 0;
}

/* Individual input field styling */
.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-field label {
    font-weight: 600;
    margin: 0;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.input-field input, 
.input-field select {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-field input:focus, 
.input-field select:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
    background: #fafbfc;
}

.input-field input:hover:not(:focus), 
.input-field select:hover:not(:focus) {
    border-color: #d1d5db;
}

/* Main Layout: Left-Right Split */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 2rem;
}

/* Commit Section Styles */
.commit-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.commit-info {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
}

.info-field:last-child {
    margin-bottom: 0;
}

.info-field strong {
    color: #374151;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.info-field span {
    color: #475569;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

.info-field pre {
    color: #475569;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 250px;
    max-width: 100%;
}

.commit-button {
    background: #0f172a;
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.commit-button:hover:not(:disabled) {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.commit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#payment-data, #commit-data {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    margin: 0;
    border: 1px solid #e2e8f0;
    min-height: 120px;
    max-height: 400px;
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1000px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
        margin-top: 2.5rem;
    }
    
    .right-column {
        position: static;
    }
}

@media (max-width: 768px) {
    body {
        padding: 2rem 1rem;
    }
    
    h1 {
        font-size: 1.875rem;
        margin-bottom: 2.5rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    .demo-controls {
        padding: 1.5rem;
    }
    
    .config-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .toggle-container {
        align-self: flex-end;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .main-layout {
        gap: 2.5rem;
        margin-top: 2rem;
    }
    
    .left-column {
        gap: 2rem;
    }
    
    .right-column {
        gap: 1.5rem;
    }
    
    .commit-controls {
        gap: 1.5rem;
    }
    
    .input-field input,
    .input-field select {
        padding: 0.875rem;
    }
    
    .commit-button {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    #payment-data, #commit-data {
        font-size: 0.8rem;
        padding: 1.25rem;
        line-height: 1.5;
    }
    
    .info-field pre {
        font-size: 0.8rem;
        padding: 0.875rem;
    }
}
