body {
    margin: 0;
    font-family: "Open Sans","Helvetica Neue",sans-serif;
    font-size: 14px;
}

.page-container {
    min-height: 100vh;
    max-width: 1500px;
    margin: auto;
    padding: 0 32px;
    display: flex;
    flex-direction: column;
}
.content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
}
.main-content {
    padding: 32px;
    flex-grow: 1;
}
.inner-content {
    border: 1px solid #c8c8c8;
    background-color: #fff;
    color: #333;
}

.page-header {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 64px;
    border-bottom: 1px solid #c8c8c8;
}
.page-header h1 {
    margin: 0;
    flex: 1;
    text-align: center;
}
.page-header .nds-logo,
.page-header .rub-logo,
.page-header .buw-logo {
    height: 56px;
    width: auto;
    max-width: 240px;
}
.page-header .rub-logo {
    margin-right: 12px;
}
.page-header .header-logos-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-header .header-logos-right {
    display: flex;
    align-items: center;
}

.sidebar {
    padding: 32px 16px;
}
.sidebar .ui-menu {
    width: 250px;
}
.sidebar .ui-menu .ui-menuitem-link {
    color: #000 !important;
    font-weight: bold !important;
    background: transparent !important;
}
.sidebar .ui-menu .ui-menuitem-link.active,
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link,
.sidebar .ui-menu .ui-menuitem-link[aria-current="page"],
.sidebar .ui-menu .ui-menuitem-link[aria-selected="true"],
.sidebar .ui-menu .ui-menuitem-link[class~="active"],
.sidebar .ui-menu .ui-menuitem-link[class*="active"],
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link[class*="active"] {
    color: #fff !important;
    background: #003560 !important;
    font-weight: bold !important;
}
.sidebar .ui-menu .ui-menuitem-link.active .ui-menuitem-icon,
.sidebar .ui-menu .ui-menuitem-link.active .ui-menuitem-text,
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link .ui-menuitem-icon,
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link .ui-menuitem-text {
    color: #fff !important;
}
.sidebar .ui-menu .ui-menuitem-link:hover, .sidebar .ui-menu .ui-menuitem-link:focus {
    background: #89ba17 !important;
    color: #fff !important;
}

.button {
    display: inline-block;
    margin: 0;
    padding: .5em 1em;
    background-color: #003560;
    color: #fff;
    border: 1px solid #003560;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border 0.3s;
    font-weight: bold;
}
.button:hover, .button:focus {
    background-color: #89ba17;
    border: 1px solid #7fad18;
    color: #fff;
}

.ui-tabs {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.ui-tabs-panels {
    flex-grow: 1;
}
.ui-tabs-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}
body .ui-tabs .ui-tabs-panels .ui-tabs-panel {
    padding: 1em;
}

.ui-tabs .ui-tabs-nav .ui-state-default {
    background: transparent !important;
    color: #003560 !important;
    font-weight: bold !important;
    transition: background 0.3s, color 0.3s;
    border-color: transparent;
}
.ui-tabs .ui-tabs-nav .ui-state-default:hover {
    background: #89ba17 !important;
    color: #fff !important;
    border-color: #7fad18 !important;
}
.ui-tabs .ui-tabs-nav .ui-state-active {
    background-color: #003560 !important;
    color: #fff !important;
    font-weight: bold !important;
    border-color: #003560 !important;
}

input[type="radio"], input[type="radio"]:checked, input[type="radio"]:focus, input[type="radio"]:hover {
    accent-color: #003560 !important;
}

pre { white-space: pre-wrap; word-wrap: anywhere; }

/* SAML Authentication Links Styling */
.saml-link {
    display: inline-block;
    padding: 12px 24px;
    margin: 8px 4px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    color: #003560;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-width: 280px;
    text-align: center;
}

.saml-link:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #89ba17;
    color: #003560;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.saml-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.auth-flow-link {
    background: linear-gradient(135deg, #007ad9 0%, #116fbf 100%);
    color: white;
    border-color: #116fbf;
}

.auth-flow-link:hover {
    background: linear-gradient(135deg, #116fbf 0%, #0d5aa3 100%);
    color: white;
    border-color: #89ba17;
}

.section-description {
    margin-bottom: 20px;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.link-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

/* Verifier Section Styling */
.verifier-section {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #003560;
    border-radius: 4px;
}

.verifier-section h3 {
    color: #003560;
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: bold;
}

.verifier-section h4 {
    color: #666;
    margin: 16px 0 12px 0;
    font-size: 14px;
    font-weight: normal;
    font-style: italic;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.link-row .saml-link {
    margin: 0;
    min-width: 240px;
    flex: 1;
}

/* SAML Authenticated Page Styling */

/* Container with explicit width constraints */
.saml-message-container {
    margin-bottom: 30px;
    width: 100%;
    max-width: 1050px; /* Fixed maximum width */
    overflow: hidden;
    box-sizing: border-box;
}

/* CodeMirror wrapper with size enforcement */
.cm-container {
    width: 100%;
    max-width: 1050px;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* Force CodeMirror to fit within wrapper - more aggressive approach */
.cm-container .CodeMirror {
    width: 1050px !important;
    max-width: 1050px !important;
    height: 300px !important;
    font-size: 12px;
    border: none !important;
    box-sizing: border-box !important;
}

.cm-container .CodeMirror-scroll {
    width: 1050px !important;
    max-width: 1050px !important;
    overflow-x: auto !important;
}

.cm-container .CodeMirror-sizer {
    width: 1050px !important;
    max-width: 1050px !important;
}

/* CTF Flag styling */
.ctf-flag-container {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #89ba17, #7fad18);
    border: 2px solid #6d8f14;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ctf-flag-container h3 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.ctf-flag-value {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    padding: 10px 20px;
    border-radius: 4px;
    display: inline-block;
    margin: 10px 0;
    word-break: break-all;
}

.ctf-attack-info {
    color: #f8f9fa;
    font-size: 14px;
    margin-top: 10px;
}

/* Authentication Status Styling */
.auth-status-success {
    color: #89ba17;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.auth-status-failed {
    color: #dc3545;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    background: #fdf2f2;
    border: 2px solid #dc3545;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
}

.auth-username {
    font-family: 'Courier New', monospace;
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.auth-username-success {
    background: rgba(137, 186, 23, 0.15);
    border-color: #89ba17;
    color: #89ba17;
}

.auth-username-failed {
    background: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    color: #dc3545;
}

/* Verification Status Styling */
.verification-true {
    color: #89ba17;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.verification-false {
    color: #dc3545;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
