:root {
    --primary: #6b1f80; /* Updated to Entrust purple color */
    --primary-light: #8a2ca3;
    --primary-dark: #4f0e66;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --warning-bg: #fff8e1;
    --warning-border: #ffeeba;
    --info: #17a2b8;
    --info-bg: #e3f2fd;
    --info-border: #bee5eb;
    --light: #f8f9fa;
    --dark: #343a40;
    --text: #212529;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --highlight-bg: #f8f9fa;
    --header-bg: #6b1f80; /* Entrust purple for header */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: #f5f7f9;
    padding: 20px;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background-color: var(--primary);
    z-index: 1000;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    background-color: white; /* Changed from purple to white for better contrast */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    border-top: 4px solid var(--primary); /* Add a purple border accent at the top */
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.entrust-logo {
    max-width: 250px;
    margin-bottom: 10px;
}

/* Update header text colors */
h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333; /* Changed from white to dark text color for better readability */
}

h1 .highlight {
    color: var(--primary); /* Changed to primary color instead of white */
    font-weight: 300;
}

header p {
    color: #444; /* Changed from white to dark gray for better readability */
    font-size: 1.1rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background-color: var(--highlight-bg);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    padding: 20px;
}

.tab-pane {
    display: none;
}

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

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0.5rem;
}

.form-section h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
}

.form-description {
    margin-bottom: 1rem;
    color: var(--secondary);
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 31, 128, 0.1);
}

input::placeholder {
    color: #adb5bd;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s ease;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 31, 128, 0.1);
}

input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--secondary);
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #5a6268;
}

.tooltip {
    display: inline-block;
    margin-left: 6px;
    position: relative;
    color: var(--secondary);
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: var(--dark);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -120px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Fix for tooltips going off-screen on the left side */
.tooltip .tooltip-text {
    transform: translateX(0);
    right: auto;
    left: -20px;  /* Position slightly to the left of the icon */
    margin-left: 0;
}

/* Make sure tooltips don't go off-screen on the right side */
@media (min-width: 768px) {
    .form-group:first-child .tooltip:hover .tooltip-text {
        left: 0;
        right: auto;
    }
}

/* For small screens, position the tooltip above and centered */
@media (max-width: 767px) {  /* Fixed typo: was a767px */
    .tooltip:hover .tooltip-text {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        margin-left: 0;
    }
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button.primary {
    background-color: var(--primary);
    color: white;
}

.button.primary:hover {
    background-color: var(--primary-dark);
}

.button.secondary {
    background-color: var(--secondary);
    color: white;
}

.button.secondary:hover {
    background-color: #5a6268;
}

.button.outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--secondary);
}

.button.outline:hover {
    background-color: var(--highlight-bg);
    border-color: var(--secondary);
}

.form-actions {
    text-align: right;
    padding-top: 1rem;
}

.secret-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: var(--highlight-bg);
    border-radius: 4px;
}

.secret-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.icon-button {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 8px;
    margin-top: 28px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.icon-button:hover {
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

.code-block {
    background-color: var(--dark);
    border-radius: 4px;
    padding: 16px;
    margin-top: 16px;
    overflow: auto;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    background-color: var(--highlight-bg);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
}

.code-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.documentation h3 {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.documentation h4 {
    margin-top: 1rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--dark);
}

.doc-section {
    margin-bottom: 1rem;
    padding-left: 10px;
    border-left: 3px solid var(--primary-light);
}

.documentation ul {
    padding-left: 20px;
    margin-bottom: 1rem;
}

.documentation p {
    margin-bottom: 0.8rem;
}

.alert {
    padding: 12px 16px;
    margin: 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert i {
    font-size: 1.1rem;
}

.warning-alert {
    background-color: var(--warning-bg);
    color: #856404;
    border-left: 4px solid var(--warning);
}

.info-alert {
    background-color: var(--info-bg);
    color: #0c5460;
    border-left: 4px solid var(--info);
}

.input-warning {
    color: #856404;
    font-size: 0.9rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-warning i {
    color: var(--warning);
}

.ca-cert-option {
    margin-top: 10px;
}

.form-preview {
    background-color: var(--highlight-bg);
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--dark);
    border-left: 3px solid var(--primary);
}

.form-preview p {
    margin: 5px 0;
}

/* Parameter table styles */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
    font-size: 0.9rem;
}

.params-table th,
.params-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border);
}

.params-table th {
    background-color: var(--highlight-bg);
    font-weight: 600;
    color: var(--dark);
}

.params-table tr:nth-child(even) {
    background-color: var(--highlight-bg);
}

.params-table tr:hover {
    background-color: rgba(107, 31, 128, 0.05);
}

.params-table code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Anchor link offset for in-page navigation */
.doc-section[id]::before {
    content: '';
    display: block;
    height: 70px;
    margin-top: -70px;
    visibility: hidden;
    pointer-events: none;
}

/* Config Generator Link Styling */
.config-generator-link {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--info-bg);
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.config-generator-link .button {
    margin-bottom: 5px;
}

.config-generator-link p {
    margin-bottom: 0;
    color: var(--dark);
    font-size: 0.95rem;
}

/* Resources List Styling */
.resources-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.resources-list li {
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: var(--highlight-bg);
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: transform 0.2s ease;
}

.resources-list li:hover {
    transform: translateX(5px);
}

.resources-list li i {
    color: var(--primary);
    margin-top: 3px;
}

.resources-list li a {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: block;
}

.resources-list li a:hover {
    text-decoration: underline;
}

.resources-list li span {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary);
    margin-top: 3px;
}

.config-generator-callout {
    margin-top: 25px;
    padding: 15px;
    background-color: var(--highlight-bg);
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    text-align: center;
}

.config-generator-callout h4 {
    margin-top: 0;
    color: var(--dark);
}

.config-generator-callout p {
    margin-bottom: 0;
}

.config-generator-callout a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.config-generator-callout a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .secret-row {
        flex-direction: column;
    }

    .icon-button {
        margin-top: 10px;
        align-self: center;
    }

    .tabs {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 12px 16px;
        white-space: nowrap;
    }

    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }

    .params-table {
        display: block;
        overflow-x: auto;
    }
}