/* =========================
   RESET / GRUNDLAYOUT
========================= */
body, html {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* =========================
   FOOTER
========================= */
footer {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-top: auto;
    z-index: 1;
}

/* =========================
   TABELLEN SPALTEN
========================= */
.delete-col { display: none; }

.delete-btn {
    cursor: pointer;
    color: #dc3545;
    font-size: 16px;
    display: none;
}

.delete-btn:hover {
    color: #a71d2a;
    transform: scale(1.2);
}

/* =========================
   NAVIGATION BUTTONS
========================= */
#prevBtn, #nextBtn {
    width: 70px;
    height: 70px;
    font-size: 28px;
    padding: 0;
    border-radius: 10px;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    font-size: 24px;
    z-index: 10;
}

.nav-btn.left { left: 0; }
.nav-btn.right { right: 0; }

.card-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-nav-top {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.nav-inline {
    pointer-events: all;
    background: rgba(0,0,0,0.05);
    border: none;
    font-size: 18px;
    padding: 4px 10px;
    border-radius: 6px;
}

.nav-inline:hover {
    background: rgba(0,0,0,0.15);
}

.scroll-btn {
    position: fixed;
    right: 20px;
    z-index: 9999;
    padding: 10px 14px;
    font-size: 18px;
    border: none;
    border-radius: 50%;
    background: #007bff;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: none;
}

#scrollTopBtn {
    bottom: 80px;
}

#scrollBottomBtn {
    bottom: 20px;
}

.scroll-btn:hover {
    background: #0056b3;
}
/* =========================
   BUTTONS
========================= */
.speak-btn {
    font-size: 22px;
    padding: 6px 12px;
    border-radius: 8px;
}

.speak-btn:hover {
    transform: scale(1.15);
    background: #e0e0e0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.translate-btn {
    width: 100%;
    font-size: 20px;
    padding: 10px;
    background: #f8f9fa;
    border: none;
}

/* =========================
   TEXT / TYPOGRAFIE
========================= */
.translation {
    display: block;
    color: #555;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 3px;
}

.merk-example .translation {
    margin-top: 5px;
}

.card-counter-top {
    display: flex;
    align-items: center;
    justify-content: space-between; /* trennt links/rechts */
}

.card-counter-top select {
    max-width: 70%;
    font-size: 0.85em;
    padding: 2px 6px;
    opacity: 0.5;
}

.card-count {
    font-size: 0.8em;
    opacity: 0.5;
}

/* =========================
   KARTEN
========================= */
#cardView { display: none; }

.merk-card {
    padding: 10px;
    background: #fff;
    border-radius: 14px;
    margin: 15px auto;
    position: relative;
    min-height: 350px;
    max-height: 500px;
    padding-bottom: 60px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    overflow-y: auto;
    text-align: center;
}

.merk-card:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

/* =========================
   KARTEN INHALT
========================= */
.merk-category {
    display: inline-block;
    background: #28a745;
    color: #FFD700;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 20px;
    margin-bottom: 18px;
}

.merk-rule {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 20px;
}

.merk-example {
    font-size: 18px;
    color: #666;
    font-style: italic;
}

/* =========================
   CARD FOOTER
========================= */
.card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eee;
    background: white;
    padding: 10px;
}

/* =========================
   NAVIGATION UNTER KARTEN
========================= */
.card-nav {
    height: 60px;
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* =========================
   TABELLEN
========================= */
/* =========================
   TABELLEN (CARD STYLE)
========================= */

#tableView {
    max-width: 900px;
    margin: 20px auto;
}

/* 🔥 überschreibt alte table-Regeln sauber */
#tableView table {
    width: 100% !important;
    table-layout: fixed;

    background: #ffffff;              /* gegen Transparenz */
    border-radius: 14px;
    overflow: hidden;                /* wichtig für runde Ecken */

    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: none;
}

/* Kopfzeile */
#tableView thead {
    background: #f8f9fa;
}

/* Zellen */
#tableView th,
#tableView td {
    padding: 12px;
    border: none;
    background: transparent; /* wichtig: NICHT überschreiben */
}

/* Zebra-Streifen */
#tableView tbody tr:nth-child(odd) td {
    background: #f9f9f9;
}

/* Hover wie Karten */
#tableView tbody tr:hover td {
    background: #eef7ee;
}

/* Optional: weichere Übergänge */
#tableView tbody tr td {
    transition: background 0.2s ease;
}


/* =========================
   FILTER
========================= */
#filter::-webkit-search-cancel-button { -webkit-appearance: none; }
#filter::-ms-clear { display: none; }

.filter-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* <-- hierdurch horizontal zentriert */
}

#filter {
    width: 100%;
    padding-right: 38px; /* Platz für X */
    box-sizing: border-box;
    height: 36px;
    font-size: 16px;
    line-height: 1.2;
}

#clear-search {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    line-height: 0;
    padding: 0;
    border: none;
    background: #ff6b6b;
    color: #fff;
    font-size: 14px;
    border-radius: 50%;
    cursor: pointer;
    display: block; /* IMMER sichtbar, kein JS nötig */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.2s;
}

#clear-search:hover {
    background: #ff4c4c;
    transform: translateY(-50%) scale(1.2);
}

/* =========================
   INPUTS / LISTEN
========================= */
input { padding: 5px; margin-bottom: 10px; width: 100%; max-width: 300px; }

ul#list { list-style-type: none; padding-left: 0; }

li { margin-bottom: 10px; }

strong { color: #2A52BE; }
em { color: #555; }

/* =========================
   MODAL
========================= */
.modal-dialog { width: 90%; max-width: 700px; }

.modal input,
.modal select,
.modal textarea { width: 100%; max-width: none; }

.modal-backdrop { background: rgba(0,0,0,0.5); z-index: 1040; }

body.modal-open { overflow: hidden; }

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    #tableView { display: none; }
    #cardView { display: block; }

    .card-nav button { display: none; }

    table { font-size: 16px !important; }
    table td, table th { font-size: 14px !important; }

    .merk-card { /* gleiche Größe wie Desktop */ }
}