/* ============================================================
   RAID-Rechner: Gehäuse und Verfahrenswahl
   Baut auf tools.css auf.
   ============================================================ */

/* Das Gehäuse: ein flaches Einbaugerät mit Montagewinkeln links und
   rechts. Die Einschübe stehen senkrecht nebeneinander wie in einem
   19-Zoll-Schrank. */
.rr-rack {
    display: flex;
    align-items: stretch;
    max-width: 1040px;
    margin: 0 auto;
}

.rr-rack-ohr {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 22px;
    flex-shrink: 0;
    padding: 12px 0;
    background: linear-gradient(90deg, #333b50 0%, #262d3f 55%, #1e2433 100%);
    border: 1px solid #161b26;
    border-radius: 4px 0 0 4px;
}
.rr-rack-ohr:last-child {
    border-radius: 0 4px 4px 0;
    background: linear-gradient(270deg, #333b50 0%, #262d3f 55%, #1e2433 100%);
}
/* Schraublöcher */
.rr-rack-ohr i {
    display: block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #12161f;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.06);
}

.rr-nas {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 16px;
    background: linear-gradient(180deg, #2b3245 0%, #212736 48%, #1b2130 100%);
    border: 1px solid #161b26;
    border-left: 0;
    border-right: 0;
    padding: 14px 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 10px 30px rgba(15,23,42,.18);
}

/* Marke links auf der Front, senkrecht wie am echten Gerät */
.rr-nas-marke {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    padding-right: 16px;
    border-right: 1px solid #161b26;
}
.rr-nas-punkt {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #4b5670;
    flex-shrink: 0;
}
.rr-nas-marke-text {
    font-family: var(--mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #8f9ab5;
    line-height: 1.3;
}
.rr-nas-marke-text small {
    display: block;
    font-size: .58rem;
    letter-spacing: .12em;
    color: #5c6681;
    margin-top: 2px;
}

/* Rechts Statusleuchten und Lüftungsschlitze */
.rr-nas-rechts {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    padding-left: 16px;
    border-left: 1px solid #161b26;
}
.rr-nas-status { display: flex; flex-direction: column; gap: 7px; }
.rr-nas-lampe {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #3c4459;
    transition: background var(--t), box-shadow var(--t);
}
.rr-nas-status.is-an .rr-nas-lampe {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52,211,153,.75);
}
.rr-nas-status.is-an .rr-nas-lampe--netz {
    background: #60a5fa;
    box-shadow: 0 0 6px rgba(96,165,250,.75);
    animation: rr-blinken 2.6s ease-in-out infinite;
}
@keyframes rr-blinken {
    0%, 88%, 100% { opacity: 1; }
    92%           { opacity: .25; }
}
.rr-nas-schlitze {
    width: 30px;
    align-self: stretch;
    border-radius: 3px;
    background: repeating-linear-gradient(
        90deg,
        #161b26 0 2px,
        transparent 2px 6px
    );
    opacity: .9;
}

/* Die Einschübe */
.rr-schaechte {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-start;
    gap: 6px;
}

.rr-schacht {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 46px;
    height: 116px;
    padding: 5px 4px 4px;
    background: #171c28;
    border: 1px solid #10141d;
    border-radius: 5px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,.55);
    overflow: hidden;
    transition: box-shadow var(--t);
}
.rr-schacht:hover { box-shadow: inset 0 2px 6px rgba(0,0,0,.55), 0 0 0 1px var(--indigo-light); }
.rr-schacht:focus-within {
    box-shadow: inset 0 2px 6px rgba(0,0,0,.55), 0 0 0 3px var(--indigo);
}

.rr-schacht-nr {
    position: relative;
    z-index: 2;
    font-family: var(--mono);
    font-size: .6rem;
    color: #616c86;
    flex-shrink: 0;
}

/* Der Einschub selbst – er fährt von unten in den Schacht */
.rr-platte-grafik {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    width: 100%;
    border-radius: 4px;
    background: #232a3a;
    border: 1px solid #2f3850;
    transform: translateY(0);
    transition: background var(--t), border-color var(--t);
}
.rr-schacht.is-belegt .rr-platte-grafik {
    background: linear-gradient(180deg, #e8eaf2 0%, #cfd4e4 100%);
    border-color: #b6bdd2;
}
.rr-schacht.is-einschub .rr-platte-grafik {
    animation: rr-einschieben .42s cubic-bezier(.2,.9,.3,1.2) both;
}
.rr-schacht.is-auswurf .rr-platte-grafik {
    animation: rr-auswerfen .3s ease-in both;
}
@keyframes rr-einschieben {
    from { transform: translateY(112%); }
    62%  { transform: translateY(-3%); }
    to   { transform: translateY(0); }
}
@keyframes rr-auswerfen {
    from { transform: translateY(0); }
    to   { transform: translateY(112%); }
}

/* Der Griff oben am Einschub */
.rr-platte-griff {
    position: absolute;
    top: 6px;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: #39415a;
    transition: background var(--t);
}
.rr-schacht.is-belegt .rr-platte-griff { background: var(--indigo); }

.rr-platte-schild {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
.rr-platte-zahl {
    font-family: var(--mono);
    font-size: .82rem;
    font-weight: 600;
    color: #1e2434;
}
.rr-platte-einheit {
    font-family: var(--mono);
    font-size: .56rem;
    letter-spacing: .1em;
    color: #58627c;
}

/* Zugriffsleuchte unten am Einschub */
.rr-platte-led {
    position: absolute;
    bottom: 7px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #333c52;
}
.rr-schacht.is-belegt .rr-platte-led {
    background: #22c55e;
    box-shadow: 0 0 5px rgba(34,197,94,.85);
    animation: rr-zugriff 3.4s steps(1, end) infinite;
}
@keyframes rr-zugriff {
    0%, 46%, 52%, 100% { opacity: 1; }
    48%, 50%           { opacity: .25; }
}

/* Ein leerer Schacht lädt zum Bestücken ein */
.rr-schacht:not(.is-belegt) .rr-platte-grafik { border-style: dashed; border-color: #38415a; }
.rr-schacht:not(.is-belegt) .rr-platte-led { display: none; }
.rr-schacht:not(.is-belegt) .rr-platte-schild::after {
    content: '+';
    font-family: var(--mono);
    font-size: 1.1rem;
    line-height: 1;
    color: #38415a;
    transition: color var(--t);
}
.rr-schacht:not(.is-belegt):hover .rr-platte-grafik,
.rr-schacht:not(.is-belegt):focus-within .rr-platte-grafik {
    border-color: var(--indigo);
    background: #262f47;
}
.rr-schacht:not(.is-belegt):hover .rr-platte-schild::after,
.rr-schacht:not(.is-belegt):focus-within .rr-platte-schild::after { color: var(--indigo-light); }

/* Das Auswahlfeld liegt unsichtbar über dem ganzen Schacht. */
.rr-select--platte {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: 0;
    cursor: pointer;
    font: inherit;
    z-index: 3;
}

.rr-nas-fuss {
    font-size: .76rem;
    color: var(--muted);
    text-align: center;
    padding-top: 14px;
}

/* Ohne Bewegung: alles steht sofort da */
@media (prefers-reduced-motion: reduce) {
    .rr-schacht.is-einschub .rr-platte-grafik,
    .rr-schacht.is-auswurf .rr-platte-grafik { animation: none; }
    .rr-schacht.is-belegt .rr-platte-led,
    .rr-nas-status.is-an .rr-nas-lampe--netz { animation: none; }
}

/* ---------- Verfahren ---------------------------------------- */
.rr-raidwahl {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}
.rr-raidkarte {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 14px 16px 14px 46px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--t), background var(--t);
}
.rr-raidkarte:hover { border-color: var(--indigo-light); }
.rr-raidkarte input {
    position: absolute;
    left: 16px;
    top: 17px;
    width: 18px;
    height: 18px;
    accent-color: var(--indigo);
    cursor: pointer;
}
.rr-raidkarte.is-aktiv {
    border-color: var(--indigo);
    background: var(--indigo-xlight);
}
.rr-raidkarte.is-unpassend { opacity: .62; }
.rr-raidkarte-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}
.rr-raidkarte-kurz {
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.5;
}
.rr-raidkarte-min {
    font-size: .76rem;
    color: var(--muted);
    font-style: italic;
}
.rr-raidkarte.is-unpassend .rr-raidkarte-min {
    color: var(--amber-deep);
    font-style: normal;
    font-weight: 600;
}

/* Auf schmalen Fenstern zählt der Platz für die Einschübe. Marke und
   Lüftungsfeld sind reine Zierde und entfallen; die Montagewinkel
   bleiben, weil sie das Gerät als solches kenntlich machen. */
@media (max-width: 700px) {
    .rr-nas { gap: 0; padding: 12px 10px; }
    .rr-nas-marke,
    .rr-nas-rechts { display: none; }
    .rr-rack-ohr { width: 15px; padding: 10px 0; }
    .rr-rack-ohr i { width: 7px; height: 7px; }
    .rr-schaechte { justify-content: center; gap: 5px; }
    .rr-schacht { width: 42px; height: 104px; }
}
