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

.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;
}
.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;
}
.ui-menu .active {
    background-color: rgba(0, 53, 96, 0.15);
}

.button {
    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:disabled {
    color: #c8c8c8;
    background-color: #003560;
    opacity: 0.5;
    cursor: not-allowed;
}
.button:hover, .button:focus {
    background-color: #89ba17;
    border: 1px solid #7fad18;
    color: #fff;
}

.main-content {
    padding: 32px;
    flex-grow: 1;
}
.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;
}

.button-row {
    display: flex;
    align-items: baseline;
}
.button-row button {
    margin: 0;
    background-color: #003560;
    color: #fff;
    border: 1px solid #003560;
    border-left-width: 0;
    padding: .3em 0.75em;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, color 0.3s, border 0.3s;
}
.button-row button:first-child {
    margin-left: 8px;
    border-left-width: 1px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}
.button-row button:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}
.button-row button:hover, .button-row button:focus {
    background-color: #89ba17;
    border-color: #7fad18;
    color: #fff;
}
.button-row button:active {
    background-color: #89ba17;
    border-color: #7fad18;
    color: #fff;
}
.button-row button.active {
    background-color: #003560;
    color: #fff;
}

.ui-tabs-panel iframe {
    flex-grow: 1;
    display: block;
    width: 100%;
    border: 1px solid #000;
    margin-top: 1em;
}

.db-reset-form {
    align-self: flex-end;
    float: right;
}
.db-reset-form .submit-check {
    vertical-align: middle;
    transition: opacity 0.1s ease-out;
    opacity: 0;
}
.db-reset-form.success .submit-check {
    opacity: 1;
}

.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;
}

.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;
}

.danger-btn, .danger-btn.ui-button, .danger-btn.ui-state-default {
    background: #c82333 !important;
    border-color: #c82333 !important;
    color: #fff !important;
    font-weight: bold;
}
.danger-btn:hover, .danger-btn:focus {
    background: #a71d2a !important;
    border-color: #a71d2a !important;
    color: #fff !important;
}
.secondary-button, .pi-sign-out {
    background: #f5f5f5 !important;
    border-color: #c8c8c8 !important;
    color: #6c757d !important;
    font-weight: bold;
}
.secondary-button:hover, .secondary-button:focus {
    background: #e0e0e0 !important;
    border-color: #7fad18 !important;
    color: #343a40 !important;
}

input.io-field, textarea.io-field {
    border: 1px solid black;
    width: 100%;
    font-family: monospace;
    padding: 8px;
}

pre {
    white-space: pre-wrap;
    word-wrap: anywhere;
}
textarea {
    resize: vertical;
}

.row {
    display: flex;
    flex-direction: row;
    column-gap: 16px;
}
.col {
    display: flex;
    flex-direction: column;
}
.col > label {
    display: block;
}

.CodeMirror {
    border: 1px solid black;
    height: auto;
    width: 100%;
    padding: 2px;
}
.CodeMirror-scroll {
    min-height: 75px;
}
.CodeMirror-wrap pre.CodeMirror-line, .CodeMirror-wrap pre.CodeMirror-line-like {
    word-break: break-word !important;
}
.CodeMirror-matchingtag {
    background: initial;
}
.CodeMirror-focused .CodeMirror-matchingtag {
    background: rgba(255, 150, 0, .3);
}

/* Schema download button styles */
.schema-download-btn {
    padding: 2px 8px;
    font-size: 11px;
    background: #003560; /* RUB blue */
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.schema-download-btn:hover {
    background: #002040; /* Darker RUB blue on hover */
    color: white;
    text-decoration: none;
}

/* Verifier label layout */
.verifier-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* CTF Flag styles */
.ctf-flag {
    display: inline-block;
    padding: 8px 12px;
    margin: 8px 0;
    background: linear-gradient(135deg, #89ba17 0%, #7fad18 100%); /* UNIGRÜN */
    color: white;
    font-weight: bold;
    font-family: monospace;
    border-radius: 6px;
    border: 2px solid #6b8c13;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pulse-flag 2s infinite;
}

@keyframes pulse-flag {
    0% { box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 4px 8px rgba(137, 186, 23, 0.4); } /* UNIGRÜN glow */
    100% { box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
}

.flag-container {
    background: #f4f8e8; /* Light UNIGRÜN background */
    border: 1px solid #89ba17; /* UNIGRÜN border */
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
}

.flag-label {
    color: #6b8c13; /* Dark UNIGRÜN */
    font-weight: bold;
    margin-bottom: 8px;
}

/* Verifier section styling */
.verifier-section {
    margin-bottom: 24px;
}

.verifier-section h3 {
    color: #003560;
    margin-bottom: 8px;
}

.verifier-description {
    margin-bottom: 16px;
    padding: 8px;
    background-color: #f8f9fa;
    border-left: 4px solid #003560;
    font-size: 14px;
}

.hints-container {
    margin-top: 16px;
}

.hints-toggle-btn {
    font-size: 12px;
    padding: 4px 8px;
}

.hints-content {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
}

.hints-content h4 {
    margin-top: 0;
    color: #856404;
}

.hints-content ol {
    margin-bottom: 0;
    font-size: 14px;
}

/* Verify button styling */
.verify-button {
    margin-top: 16px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: bold;
    min-width: 200px;
    background-color: #89ba17; /* RUB green */
    border-color: #7fad18;
    transition: all 0.3s ease;
}

/* XPath Exercises Styling */
.xpath-exercises-container {
    padding: 20px;
}

.intro-text {
    background-color: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #003560;
    margin-bottom: 20px;
}

.exercise-selection {
    margin: 20px 0;
}

.exercise-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.exercise-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.exercise-label:hover {
    border-color: #89ba17;
    background-color: #f8f9fa;
}

.exercise-label input[type="radio"]:checked ~ .exercise-badge {
    background-color: #89ba17;
    color: white;
}

.exercise-badge {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    transition: all 0.2s;
}

.difficulty {
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.difficulty.easy {
    background-color: #d4edda;
    color: #155724;
}

.difficulty.medium {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty.hard {
    background-color: #f8d7da;
    color: #721c24;
}

.difficulty.very-hard {
    background-color: #dc3545;
    color: white;
}

.difficulty.master {
    background-color: #6f42c1;
    color: white;
    font-weight: 700;
}

.exercise-description {
    margin: 20px 0;
}

.description-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #89ba17;
    padding: 16px;
    border-radius: 4px;
}

.description-box p {
    margin: 8px 0;
}

.xpath-input {
    width: 100%;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.xpath-input:focus {
    outline: none;
    border-color: #89ba17;
}

.hint-text {
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
}

.form-section {
    margin: 24px 0;
}

#xpathFlagDisplay {
    background: linear-gradient(135deg, #89ba17 0%, #7fad18 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#xpathResult {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 16px;
    border-radius: 4px;
}
