/* MDM Colors */
:root {
    --md-blue: #1f3e61;
    --md-gold: #b8860b;
    --md-brown: #7a4a0e;
    --md-radius: .5em;
}

/* Pastellige Hintergrundabstufungen (≈10 % Opazität) */
:root {
    --md-blue-10: rgba(22, 58, 102, .10);
    --md-gold-10: rgba(197, 154, 42, .10);
    --md-brown-10: rgba(139, 90, 42, .10);
}

/* Basic form styles */
.mdm-box {
    background: #f8f8f9;
    padding: 1.5em;
    margin: 1em auto;
    border-radius: var(--md-radius);
    max-width: 50em;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}

.mdm-form label {
    display: block;
    margin-bottom: 0.75em;
}

.mdm-form input {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: var(--md-radius);
}

.mdm-form button {
    padding: 0.75em 1.5em;
    border: none;
    border-radius: var(--md-radius);
    background: #0073aa;
    color: #fff;
    cursor: pointer;
}

/* Account Page */
.mdm-account-wrap {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    position: relative;
}

.mdm-profiles-box {
    flex: 1;
}

.mdm-new-profile-box {
    flex: 1;
}

.mdm-profile-links {
    list-style: none;
    margin: 0;
    padding: 0
}

.mdm-profile-links li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #e2e2e2;
    transition: background .2s, font-weight .2s
}

.mdm-profile-links li:hover {
    background: #FFF3B1
}

.mdm-entry-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 1;
    min-width: 0
}

.mdm-profile-name {
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 180px
}

.mdm-mdm-info {
    font-size: 12px;
    color: #666;
    white-space: nowrap
}

.mdm-profile-actions a {
    margin-left: 8px;
    text-decoration: none;
    color: #555
}

.mdm-profile-actions a:hover {
    color: #000
}

.mdm-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500
}

.mdm-form input {
    width: 100%;
    padding: 4px;
    margin-top: 2px
}

.mdm-form button {
    margin-top: 8px
}

.mdm-profile {
    margin-top: 2rem
}

.mdm-chart svg {
    max-width: 100%
}

pre.mdm-json {
    max-width: 100%;
    overflow: auto;
    background: #fafafa;
    padding: 1rem;
    border: 1px solid #eee
}

/**
 * MDM Reading
 */

article.mdm-reading {
    max-width: 50em;
}

.mdm-reading__title {
    background: var(--md-blue);
    border-radius: var(--md-radius);
    box-shadow: 0 0 0.5em 0 #99999933;
    color: #f2f2f2;
    padding: .3em 1.5em;
    text-align: center;
    font-weight: bold;
}

.mdm-reading__visuals {
    display: flex;
    gap: 2em;
    align-items: flex-start;
}

.mdm-reading__chart {
    flex: 1
}

.mdm-reading__core {
    border-radius: var(--md-radius);
    box-shadow: 0 0 0.5em 0 #99999977;
    flex: 0 0 18rem;
    background: white;
    overflow: hidden;
}

.mdm-reading__core h2 {
    border-bottom: 2px solid var(--md-gold);
    padding: .2em .5em;
    background: #1f3e61;
    color: white;
    margin: 0;
}

/* === Core-Liste: zweispaltige Definition List ========================= */
.mdm-reading__core-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    margin-block-start: 0;
    margin-block-end: 0;
}

/* Grundlayout der Label/Werte */
.mdm-reading__core-list dt,
.mdm-reading__core-list dd {
    padding: .5em 1em;
    margin-inline-start: 0;
}

/* === Farbzuweisung per nth-child-Magie =============================== */
/* 1. Zeile (Geburtsdatum) – Blau */
.mdm-reading__core-list dt:nth-child(4n+1),
.mdm-reading__core-list dd:nth-child(4n+2) {
    background: var(--md-blue-10);
    color: var(--md-blue);
}

/* 2. Zeile (Typ) – Gold */
.mdm-reading__core-list dt:nth-child(4n+3),
.mdm-reading__core-list dd:nth-child(4n+4) {
    background: var(--md-gold-10);
    color: var(--md-gold);
}

/* 3. Zeile (Profil) – Braun */
.mdm-reading__core-list dt:nth-child(4n+5),
.mdm-reading__core-list dd:nth-child(4n+6) {
    background: var(--md-brown-10);
    color: var(--md-brown);
}

/* 4. Zeile (Autorität) – Blau wiederholen … und so weiter                */
.mdm-reading__core-list dt:nth-child(4n+7),
.mdm-reading__core-list dd:nth-child(4n+8) {
    background: var(--md-blue-10);
    color: var(--md-blue);
}

/* === MDM Modal ======================================================= */
button#mdm-open-modal {
    background: var(--md-blue);
    border-radius: var(--md-radius);
    cursor: pointer;
    padding: .5em 1em;
    border: 2px solid var(--md-gold);
    color: #f2f2f2;
    font-weight: 600;
    font-size: .8em;
    position: absolute;
    right: 1.5em;
    top: 1.5em;
}

.mdm-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    z-index: 1000;
}

.mdm-modal-backdrop.is-open {
    display: flex;
    max-width: 100%;
}

.mdm-modal {
    position: relative;
    background: #fff;
    color: #333;
    padding: 2rem;
    max-width: 640px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--md-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
}

.mdm-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    width: 1.5rem;
    height: 1.5rem;
    color: currentColor;
}

/* Adapt inputs to theme spacing */
.mdm-modal .mdm-form label {
    display: block;
    margin-bottom: 1rem;
}

.mdm-modal .mdm-form input, .mdm-modal .mdm-form button {
    width: 100%;
}

.mdm-modal .mdm-form button {
    margin-top: 1.5rem;
}