/* 
 * Hydrigital Authentication Server Documentation Styles
 * Extracted from index.php for better maintainability
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    overflow-x: hidden;
    box-sizing: border-box;
    word-wrap: break-word;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    max-width: 100%;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

h1, h2 {
    color: #495057;
    font-weight: 600;
}

h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

h2 {
    font-size: 22px;
    margin: 25px 0 15px 0;
}

h3 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    text-align: left;
}

h4 {
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 10px 0;
    text-align: left;
}

/* Section headers styling */
.section-header {
    text-align: left;
    margin-bottom: 20px;
}

.section-header h3,
.section-header p {
    text-align: left;
    margin-left: 0;
}

.integration-section {
    margin-bottom: 30px;
}

.integration-section h3,
.integration-section h4,
.integration-section p {
    text-align: left;
}

h4 {
    color: #6c757d;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px 0;
}

p {
    color: #6c757d;
    line-height: 1.6;
    margin: 10px 0;
}

.config-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.config-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.config-section input, .config-section select, .config-section textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: monospace;
    box-sizing: border-box;
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.response {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    font-family: monospace;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-x: auto;
}

.success {
    border-color: #28a745;
    background: #d4edda;
}

.error {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.step {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.step:last-child {
    border-bottom: none;
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}

.step-title {
    display: inline-block;
    vertical-align: top;
    margin-top: 5px;
    font-size: 18px;
    font-weight: 500;
}

.token-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.token-actions button {
    background: #6c757d;
    font-size: 12px;
    padding: 6px 12px;
    margin: 2px;
}

.token-actions button:hover {
    background: #545b62;
}

.endpoint-info {
    background: #e9ecef;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
    color: #495057;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-ok { background: #28a745; }
.status-error { background: #dc3545; }
.status-warning { background: #ffc107; }
.status-info { background: #17a2b8; }

/* Documentation styles */
.endpoint-info h4 {
    color: #495057;
    margin: 15px 0 10px 0;
    font-size: 16px;
}

.endpoint-info h5 {
    color: #6c757d;
    margin: 10px 0 8px 0;
    font-size: 14px;
}

.endpoint-info ul {
    margin: 8px 0;
    padding-left: 20px;
}

.endpoint-info li {
    margin: 4px 0;
    line-height: 1.4;
}

.endpoint-info table {
    font-size: 13px;
    border: 1px solid #dee2e6;
    width: 100%;
    border-collapse: collapse;
}

.endpoint-info table th,
.endpoint-info table td {
    padding: 8px;
    border: 1px solid #dee2e6;
}

.endpoint-info pre {
    font-size: 12px;
    line-height: 1.4;
    margin: 10px 0;
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

.endpoint-info code {
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

/* Navigation menu styles */
.nav-menu {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.nav-menu a {
    text-decoration: none;
    color: #007bff;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: block;
    transition: all 0.2s ease;
}

.nav-menu a:hover {
    background: #e9ecef !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Server navigation styles */
.server-nav {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 4px solid #2196f3;
}

.server-nav h4 {
    margin: 0 0 5px 0;
    color: #1976d2;
}

.server-nav p {
    margin: 0;
    color: #1565c0;
    font-size: 14px;
}

.server-nav a {
    text-decoration: none;
    color: white;
    background: #2196f3;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.2s ease;
}

.server-nav a:hover {
    background: #1976d2;
}

/* Alert/Note styles */
.note {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* Grid layouts */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.flex-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 12px;
    }
    
    .step-title {
        font-size: 16px;
    }
    
    .grid-auto-fit {
        grid-template-columns: 1fr;
    }
    
    .flex-wrap {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Code Block Improvements */
pre {
    background: #1a1a1a !important;
    color: #f8f8f2 !important;
    padding: 20px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 15px 0 !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: 1px solid #444 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: pre !important;
    word-wrap: normal !important;
    word-break: normal !important;
}

pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    border: none !important;
    font-size: inherit !important;
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    display: block !important;
}

/* Inline code */
code {
    background: #f4f4f4;
    color: #d73a49;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9em;
    border: 1px solid #e1e4e8;
}

/* Tab content and wide content containers */
.tab-content, .tabs-container, .example-content {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.tab-content pre,
.tabs-container pre,
.example-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
}

/* Specific handling for documentation sections */
.documentation-section {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.documentation-section pre {
    max-width: 100%;
    overflow-x: auto;
}

/* Content width constraints */
.container {
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

/* Fix for step content and documentation sections */
.step-content, .documentation-section, .example-content {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

/* Tab content styling */
.example-content {
    max-width: 100%;
    overflow: hidden;
}

.example-content pre {
    white-space: pre;
    overflow-x: auto;
    max-width: 100%;
}

/* Tables responsive styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow-x: auto;
    display: table;
    table-layout: auto;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* Specific styling for scope tables */
.scopes-table {
    table-layout: auto !important;
    width: 100% !important;
    border-collapse: collapse;
    margin: 15px 0;
    max-width: none !important;
}

.scopes-table th:first-child,
.scopes-table td:first-child {
    width: auto !important;
    min-width: 150px !important;
    white-space: nowrap;
    overflow: visible !important;
    text-overflow: clip !important;
}

.scopes-table th:last-child,
.scopes-table td:last-child {
    width: auto !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.scopes-table code {
    white-space: nowrap;
    word-break: normal;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.scopes-table th,
.scopes-table td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: top;
}

.scopes-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.scopes-table thead tr {
    background-color: #e9ecef !important;
}

/* Tab system styling */
.tabs {
    margin: 20px 0;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 5px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px 8px 0 0;
}

.tab-button {
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #495057;
    font-size: 13px;
}

.tab-button:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
}

.tab-button.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 0;
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    border: 1px solid #dee2e6;
    border-top: none;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.tab-content.active {
    display: block;
}

/* Fix for section headers in tab content */
.tab-content h3,
.tab-content h4 {
    margin: 20px 20px 15px 20px;
    padding: 0;
    color: #495057;
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    position: relative;
}

.tab-content h4 {
    font-size: 16px !important;
    margin: 15px 20px 10px 20px;
}

.tab-content p {
    margin: 10px 20px;
    color: #6c757d;
    line-height: 1.5;
}

.tab-content pre {
    margin: 15px 20px !important;
}

/* Form styling improvements */
.config-section input, .config-section select, .config-section textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: monospace;
    box-sizing: border-box;
    max-width: 100%;
}
.btn, .btn-primary, .btn-secondary, .btn-success, .btn-accent {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

.btn-accent {
    background: #17a2b8;
    color: white;
}

.btn-accent:hover {
    background: #117a8b;
    transform: translateY(-1px);
}

/* Card layouts for better organization */
.approach-grid, .quick-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.approach-card, .quick-start-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.approach-card:hover, .quick-start-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.approach-card h4, .quick-start-card h3 {
    margin-top: 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

/* Integration sections with headers above content */
.integration-section {
    display: block;
    margin: 25px 0;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.section-header h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Steps timeline styling */
.steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin: 20px 0;
    max-width: 100%;
}

.step {
    display: block;
    padding: 0;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.step h3 {
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

.step p {
    margin: 0;
    padding: 15px 20px;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px solid #f1f3f4;
}

.step-number {
    background: #007bff;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 13px;
}

.step-content {
    flex: 1;
    max-width: calc(100% - 43px);
}

.step-content h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 15px;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

/* Example tabs within sections */
.example-tabs {
    margin: 0;
}

.example-tabs .tab-buttons {
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid #e9ecef;
}

.example-tabs .tab-content {
    border: none;
    border-radius: 0;
}

/* CTA section */
.cta-section {
    text-align: center;
    margin: 25px 0;
    padding: 25px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Better button styling */
.btn, .btn-primary, .btn-secondary, .btn-success, .btn-accent {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    line-height: 1.4;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #545b62;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn-success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
    transform: translateY(-1px);
}

.btn-accent {
    background: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

.btn-accent:hover {
    background: #117a8b;
    border-color: #117a8b;
    transform: translateY(-1px);
}

/* Responsive improvements */
@media (max-width: 768px) {
    body {
        padding: 15px;
        max-width: 100%;
    }
    
    .container {
        padding: 20px;
        margin: 0 0 15px 0;
    }
    
    pre {
        font-size: 12px !important;
        padding: 15px !important;
        overflow-x: auto !important;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .approach-grid, .quick-start-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .steps-timeline .step {
        margin-bottom: 20px;
    }
    
    .step h3 {
        padding: 15px;
        font-size: 16px !important;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .step p {
        padding: 12px 15px;
        text-align: center;
    }
    
    .step-content {
        max-width: 100%;
    }
    
    table {
        font-size: 12px;
    }
    
    .tab-buttons {
        flex-direction: column;
        padding: 8px;
    }
    
    .tab-button {
        border-radius: 4px;
        margin-bottom: 5px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .tab-content {
        border-radius: 0 0 6px 6px;
        overflow-x: auto;
    }
    
    .tab-content h3,
    .tab-content h4 {
        font-size: 16px !important;
        margin: 15px 15px 10px 15px;
    }
    
    .tab-content h4 {
        font-size: 14px !important;
    }
    
    .tab-content p {
        margin: 8px 15px;
        font-size: 13px;
    }
    
    .tab-content pre {
        margin: 10px 15px !important;
    }
    
    .config-section input, 
    .config-section select, 
    .config-section textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    body {
        padding: 10px;
        max-width: 95%;
    }
    
    .container {
        padding: 15px;
    }
    
    pre {
        font-size: 11px !important;
        padding: 10px !important;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .approach-card, .quick-start-card {
        padding: 15px;
    }
    
    .step {
        padding: 12px;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* New Get Started Section Styles */
.get-started-section {
    margin-top: 20px;
}

.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.approach-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.approach-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.approach-card h4 {
    margin-top: 0;
    color: #495057;
}

.steps-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.step-number {
    background: #007bff;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 8px 0;
    color: #495057;
}

.step-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.cta-section {
    text-align: center;
    padding: 30px 20px;
    background: #e9ecef;
    border-radius: 8px;
    margin-top: 30px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Responsive improvements for new components */
@media (max-width: 768px) {
    .approach-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-timeline {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Development Tools Styling */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tool-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    overflow: hidden;
}

.tool-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.tool-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.tool-header h4 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.tool-header p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

.tool-content {
    padding: 20px;
}

.input-button-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-button-group input {
    flex: 1;
}

.input-button-group button {
    flex-shrink: 0;
    white-space: nowrap;
}

.textarea-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.textarea-button-group button {
    align-self: flex-start;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.button-grid button {
    padding: 10px 15px;
    font-size: 14px;
}

/* Enhanced form controls for tools */
.tool-content .form-control {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.tool-content .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    outline: none;
}

.tool-content label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    display: block;
}

/* Button styling for tools */
.tool-content .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tool-content .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
}

.tool-content .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tool-content .btn-secondary:hover {
    background: linear-gradient(135deg, #545b62 0%, #454d55 100%);
    transform: translateY(-1px);
}

/* Responsive design for tools */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .input-button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-button-group button {
        width: 100%;
    }
    
    .button-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Testing Interface Styling */
.environment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    overflow: hidden;
}

.env-card, .config-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.env-card h4, .config-card h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.env-override {
    margin-top: 20px;
}

.env-override h5 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
}

.btn-env {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-env:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-env.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.scope-selection-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.scope-selection-card h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.scope-categories {
    margin: 20px 0;
}

.scope-category {
    margin-bottom: 20px;
}

.scope-category h5 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.scope-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.scope-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.scope-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.scope-btn.selected {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Invalid scope buttons for testing */
.scope-btn-invalid {
    background: #fff3cd !important;
    border-color: #ffeaa7 !important;
    color: #856404 !important;
}

.scope-btn-invalid:hover {
    background: #ffeaa7 !important;
    border-color: #fd79a8 !important;
    color: #721c24 !important;
}

.scope-btn-invalid.selected {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.selected-scopes {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.selected-scopes label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.scope-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-small {
    background: #6c757d;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-small:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

.form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.status-item {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
    overflow: hidden;
    min-width: 0;
}

.status-item label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 2px;
    display: block;
}

.status-value {
    font-size: 13px;
    color: #6c757d;
    font-family: monospace;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Responsive design for testing interface */
@media (max-width: 768px) {
    .environment-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .scope-buttons {
        gap: 6px;
    }
    
    .scope-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .btn-small {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Additional Testing Interface Styles */
.result-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    background: #f8f9fa;
    border-left: 4px solid #17a2b8;
    overflow-x: auto;
}

.result-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.result-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.result-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.result-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.device-flow-info {
    text-align: center;
}

.device-code-display {
    padding: 1.5rem;
    background: #e7f3ff;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.user-code {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    border-radius: 4px;
    letter-spacing: 2px;
}

.expires-info {
    color: #6c757d;
    font-style: italic;
    margin-top: 1rem;
}

.endpoints-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.endpoint-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.endpoint-name {
    font-weight: 600;
    color: #495057;
}

.endpoint-url {
    font-family: 'Courier New', monospace;
    color: #007bff;
    word-break: break-all;
}

.polling-status,
.polling-success,
.polling-error,
.polling-pending,
.polling-timeout {
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    margin-top: 1rem;
}

.polling-status {
    background: #e7f3ff;
    color: #007bff;
}

.polling-success {
    background: #d4edda;
    color: #155724;
}

.polling-error {
    background: #f8d7da;
    color: #721c24;
}

.polling-pending {
    background: #fff3cd;
    color: #856404;
}

.polling-timeout {
    background: #e2e3e5;
    color: #6c757d;
}

/* Request Log Styles */
.log-entry {
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.log-request .log-header {
    background: #e7f3ff;
    color: #007bff;
}

.log-response .log-header {
    background: #f8f9fa;
    color: #6c757d;
}

.log-content {
    padding: 1rem;
    background: white;
}

.log-content pre {
    margin: 0.5rem 0 0 0;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 3px;
    font-size: 0.875rem;
}

.log-operation {
    color: inherit;
}

.log-timestamp {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Form enhancements */
.form-control {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button state improvements */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.btn-success:disabled,
.btn-accent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

/* Code highlighting improvements */
.result-box pre {
    margin: 0;
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

/* Additional responsive improvements */
@media (max-width: 768px) {
    .endpoint-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .endpoint-url {
        font-size: 0.875rem;
    }
    
    .device-code-display {
        padding: 1rem;
    }
    
    .user-code {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
    
    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .result-box {
        padding: 0.75rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .button-group .btn-primary,
    .button-group .btn-secondary,
    .button-group .btn-danger,
    .button-group .btn-success,
    .button-group .btn-accent {
        width: 100%;
        margin: 0;
    }
}

/* Button group styling */
.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-group .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

/* PKCE-specific styles */
.pkce-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.pkce-grid > div {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.pkce-grid label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: #6c757d;
    word-break: break-all;
    line-height: 1.4;
    background: #fff;
    padding: 0.5rem;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    display: block;
    min-height: 20px;
}

@media (max-width: 768px) {
    .pkce-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}
