/* ==========================================================================
   /\ iris Download – App-Shell & Komponenten
   Farbwerte ausschließlich über Tokens aus theme.css
   ========================================================================== */

html {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(14px, 1.2vw, 18px);
    height: 100vh;
    height: 100dvh;
    width: 100%;
    color: var(--text-primary);
    overflow: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Hintergrund: Video + Diffusor ───────────────────────── */

#bgVideo {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    aspect-ratio: 1920/1080;
    z-index: -10;
}

.diffusor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-body-overlay);
    z-index: -5;
}

/* ── App-Shell: Kopf / Inhalt / Fuß ──────────────────────── */

.app_controller {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app_controller::-webkit-scrollbar {
    display: none;
}

.app_head {
    height: 5vh;
    min-height: 44px;
    width: 100%;
    background-color: var(--bg-header);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding-left: 1vw;
    padding-right: 1vw;
    font-size: clamp(14px, 1.1vw, 17px);
    overflow: visible;
}

.app_head_left,
.app_head_right {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5vw;
}

.antilo_logo {
    white-space: nowrap;
    color: var(--text-primary);
}

.antilo_clamp {
    color: red;
}

.head_separator {
    width: 1px;
    height: 2.5vh;
    min-height: 16px;
    background-color: var(--border-head-sep);
    margin: 0 0.5vw;
}

/* ── Kopfzeile: Sprachumschalter ─────────────────────────── */

.head_lang_wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.head_lang_flag {
    height: clamp(16px, 2.2vh, 22px);
    border-radius: 3px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.head_dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 1vh);
    right: 0;
    min-width: 10em;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5vw;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 50;
    overflow: hidden;
    padding: 0.5vh 0;
}

.head_dropitem {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0.8em;
    padding: 1vh 1em;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.lang_drop_flag {
    height: 1.1em;
    border-radius: 2px;
}

/* ── Kopfzeile: Dark/Light-Umschalter ────────────────────── */

.head_viewmode_toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, 3.4vh, 34px);
    height: clamp(28px, 3.4vh, 34px);
    border-radius: 50%;
    border: solid 1px transparent;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.head_viewmode_icon {
    width: clamp(16px, 2.2vh, 22px);
    height: clamp(16px, 2.2vh, 22px);
}

/* ── Inhalt ──────────────────────────────────────────────── */

.app_content {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app_content::-webkit-scrollbar {
    display: none;
}

.dl_stage {
    width: min(92vw, 1100px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 5vh;
    padding-bottom: 5vh;
}

.dl_hero {
    text-align: center;
    margin-bottom: 5vh;
}

.dl_hero_logo {
    font-size: clamp(34px, 4.5vw, 64px);
    color: var(--text-strong);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.dl_hero_claim {
    margin-top: 1vh;
    font-size: clamp(16px, 1.5vw, 24px);
    color: var(--text-label);
}

.dl_hero_intro {
    margin: 2vh auto 0 auto;
    max-width: 40em;
    color: var(--text-desc);
    line-height: 1.5;
}

/* ── Lade-/Fehlerzustand ─────────────────────────────────── */

.dl_state {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2vh;
    padding: 5vh 0;
    text-align: center;
    color: var(--text-muted);
}

.dl_state img {
    width: clamp(40px, 6vw, 64px);
    height: clamp(40px, 6vw, 64px);
}

.dl_state_error_text {
    border: solid 1px red;
    background-color: rgba(255, 0, 0, 0.3);
    color: var(--text-strong);
    border-radius: 2vh;
    padding: 1.2vh 1.5em;
    max-width: 34em;
    line-height: 1.5;
}

/* ── Plattform-Gruppen & Karten ──────────────────────────── */

.dl_group {
    margin-bottom: 4vh;
}

.dl_group_head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7em;
    padding: 0 0.2em 1.2vh 0.2em;
    border-bottom: 1px solid var(--border-separator);
    margin-bottom: 2vh;
}

.plat_icon {
    width: clamp(20px, 2.6vh, 28px);
    height: clamp(20px, 2.6vh, 28px);
}

.dl_group_title {
    font-size: clamp(17px, 1.5vw, 23px);
    color: var(--text-strong);
    white-space: nowrap;
}

.dl_group_badge {
    border: solid 1px #4CAF50;
    background-color: rgba(76, 175, 80, 0.25);
    color: var(--text-strong);
    border-radius: 100vw;
    padding: 0.3vh 1em;
    font-size: clamp(11px, 0.9vw, 14px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dl_cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5vh 1vw;
}

.dl_card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: 1vw;
    padding: 2vh 1.4em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2vh;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
    .dl_card:hover {
        border-color: var(--border-hover);
        background-color: var(--bg-hover);
        box-shadow: var(--shadow);
    }
}

.dl_card_desc {
    color: var(--text-strong);
    font-size: clamp(15px, 1.2vw, 19px);
    line-height: 1.4;
}

.dl_card_meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3em 1.2em;
    color: var(--text-dim);
    font-size: clamp(12px, 0.95vw, 15px);
}

.dl_card_file {
    word-break: break-all;
}

.dl_card_actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

/* ── Empfohlener Bereich: mittig ─────────────────────────── */

/* Statt Grid ein zentrierter Flex-Fluss: eine einzelne Karte
   steht damit in der Mitte statt links in der ersten Spalte. */
.dl_group_rec .dl_cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.dl_group_rec .dl_card {
    flex: 0 1 22em;
    max-width: 100%;
    text-align: center;
}

.dl_group_rec .dl_group_head,
.dl_group_rec .dl_card_meta,
.dl_group_rec .dl_card_actions {
    justify-content: center;
}

/* ── Aufklapper "weitere Plattformen" ────────────────────── */

.dl_more_toggle {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    margin: 1vh auto 0 auto;
    padding: 1vh 1.5em;
    border-radius: 100vw;
    border: solid 1px transparent;
    color: var(--text-label);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dl_more_chevron {
    width: 1.3em;
    height: 1.3em;
    transition: transform 0.2s;
}

.dl_more_toggle.open .dl_more_chevron {
    transform: rotate(180deg);
}

.dl_more {
    display: none;
}

.dl_more.open {
    display: block;
}

/* ── Tabelle "weitere Plattformen" ───────────────────────── */

.dl_table {
    display: grid;
    grid-template-columns: max-content 1fr max-content max-content max-content;
    background-color: var(--bg-section);
    border: 1px solid var(--border-subtle);
    border-radius: 1vw;
    overflow: hidden;
    margin-top: 2vh;
}

.dl_trow {
    display: contents;
}

.dl_tcell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6em;
    padding: 1.6vh 1em;
    border-bottom: 1px solid var(--border-subtle);
    min-width: 0;
}

.dl_trow:last-child .dl_tcell {
    border-bottom: none;
}

.dl_tcell_plat {
    color: var(--text-strong);
    white-space: nowrap;
}

.dl_tcell_desc {
    color: var(--text-primary);
    line-height: 1.4;
}

.dl_tcell_ver,
.dl_tcell_size {
    color: var(--text-dim);
    white-space: nowrap;
    font-size: clamp(12px, 0.95vw, 15px);
    justify-content: flex-end;
}

.dl_tcell_action {
    justify-content: flex-end;
}

/* ── Store-Badges (App Store / Google Play) ──────────────── */

.store_badge_link {
    display: inline-flex;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.store_badge {
    height: clamp(36px, 5vh, 46px);
    display: block;
}

.dl_tcell .store_badge {
    height: clamp(30px, 4vh, 38px);
}

@media (hover: hover) {
    .dl_more_toggle:hover {
        border-color: var(--border-hover);
        background-color: var(--bg-hover-subtle);
    }

    .dl_trow:hover .dl_tcell {
        background-color: var(--bg-hover-subtle);
    }

    .store_badge_link:hover {
        opacity: 0.85;
    }
}

/* ── Download-Button (Konvention aus dialog.css) ─────────── */

.button {
    padding: 0.8vh 1.2em;
    border-radius: 2vh;
    border: solid 2px transparent;
    text-align: center;
    color: var(--text-secondary);
    background-color: var(--bg-input);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.button-active {
    border-color: #4CAF50;
    color: var(--text-strong);
}

.button-small {
    padding: 0.5vh 1em;
    font-size: clamp(12px, 0.95vw, 15px);
}

.dl_btn_icon {
    width: 1.1em;
    height: 1.1em;
}

@media (hover: hover) {
    .button-active:hover {
        background-color: green;
        border-color: green;
        color: white;
    }

    .head_viewmode_toggle:hover {
        border-color: var(--text-secondary);
        background-color: var(--bg-hover-icon);
    }

    .head_dropitem:hover {
        background-color: var(--bg-hover);
    }

    .head_lang_flag:hover {
        opacity: 0.8;
    }
}

/* ── Fußzeile ────────────────────────────────────────────── */

.app_footer {
    height: 5vh;
    min-height: 36px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 1vw;
    padding-right: 1vw;
    background-color: var(--bg-footer);
    font-size: clamp(12px, 1vw, 15px);
    color: var(--text-muted);
}

.glink {
    color: var(--text-link);
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .glink:hover {
        text-decoration: underline;
    }
}

/* ── Responsiv: Smartphone ───────────────────────────────── */

@media (max-width: 700px) {
    .app_head,
    .app_footer {
        padding-left: 3vw;
        padding-right: 3vw;
    }

    .app_head_left .antilo_logo {
        display: none;
    }

    .head_separator {
        margin: 0 2vw;
    }

    .dl_hero {
        margin-bottom: 3vh;
    }

    .dl_group_head {
        flex-wrap: wrap;
        row-gap: 0.8vh;
    }

    .dl_card {
        border-radius: 3vw;
    }

    .head_dropdown {
        border-radius: 2vw;
    }

    /* Tabelle wird zur gestapelten Liste */
    .dl_table {
        display: block;
        border-radius: 3vw;
    }

    .dl_trow {
        display: block;
        padding: 1.8vh 1em;
        border-bottom: 1px solid var(--border-subtle);
    }

    .dl_trow:last-child {
        border-bottom: none;
    }

    .dl_tcell {
        padding: 0;
        border-bottom: none;
    }

    .dl_trow:last-child .dl_tcell {
        border-bottom: none;
    }

    .dl_tcell_plat {
        margin-bottom: 0.6vh;
    }

    .dl_tcell_desc {
        margin-bottom: 0.6vh;
    }

    .dl_tcell_ver,
    .dl_tcell_size {
        display: inline-flex;
        justify-content: flex-start;
        margin-right: 1.5em;
    }

    .dl_tcell_action {
        justify-content: flex-end;
        margin-top: 1vh;
    }
}
