/* ==========================================================================
   Darkirella2 — site.css
   Ergänzt das eigens kompilierte Custom-Bootstrap (siehe
   wwwroot/lib/bootstrap-custom, Quelle unter build/bootstrap) um die
   Design-Signatur der Seite: den Blurple-Presence-Glow, die Typo-Rollen
   (Space Grotesk / Inter / JetBrains Mono) und die Leaderboard-/Karten-Details.

   Alle Klassennamen, die in den .cshtml-Views oder im Layout-Script referenziert
   werden, bleiben als Selektoren erhalten (nur Werte wurden neu gestaltet):
   .page-sticky, .page-title-*, .*-icon, .card.quote-card, .drink-card,
   .timer-table, .dark-bg-secondary/.dark-text-light/.dark-subtle, .glitch-*,
   .rank-row, .min-w-0, .bottom-nav/.bn-link, .admin-badge, .navbar-divider*.
   ========================================================================== */

:root {
    --navbar-h: 64px;
    --bottomnav-h: 64px;

    /* Markenfarben (siehe build/bootstrap/src/custom.scss) - hier zusätzlich
       als Variablen verfügbar für Stellen, die nicht über Bootstrap-Utilities
       laufen (Glow, Gradients, Glitch-Easter-Egg). */
    --dk-blurple: #5865F2;
    --dk-blurple-deep: #3C45A5;
    --dk-green: #57F287;
    --dk-gold: #FEE75C;
    --dk-fuchsia: #EB459E;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    padding-top: var(--navbar-h);
    font-feature-settings: "cv11", "ss01";
}

main {
    flex: 1 0 auto;
}

/* Space Grotesk als Display-Schrift für alle Überschriften und
   hervorgehobene Titel-Elemente; Zahlen/Codes/Commands laufen über
   JetBrains Mono (siehe .font-mono / <code>). */
h1, h2, h3, h4, h5, h6,
.page-title-leaderboard, .page-title-quotes, .page-title-drinks,
.page-title-timer, .page-title-logs, .page-title-birthdays,
.page-title-streak, .navbar-brand {
    font-family: "Space Grotesk", var(--bs-font-sans-serif);
    letter-spacing: -0.01em;
}

code, kbd, .font-mono {
    font-family: "JetBrains Mono", var(--bs-font-monospace);
    font-size: .875em;
}

/* ---- Navbar (Desktop) ---------------------------------------------------- */

.navbar.fixed-top {
    background-color: rgba(11, 13, 20, 0.86) !important;
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

/* Navbar bleibt bewusst durchgängig dunkel (navbar-dark in _Layout.cshtml),
   auch im hellen Seiten-Theme - Kontrast der navbar-dark-Textfarben wäre auf
   einem hellen Hintergrund sonst nicht mehr gegeben. */

.navbar-brand {
    font-weight: 700;
    font-size: 1.05rem;
}

/* Signature-Element: dezenter "Presence"-Glow hinter dem Bot-Avatar, angelehnt
   an Discords eigenes Online-Status-Leuchten. Bewusst nur an zwei Stellen
   eingesetzt (Navbar-Logo + Startseite), nicht als generisches Deko-Muster. */
.presence-avatar {
    position: relative;
    display: inline-flex;
}

.presence-avatar img {
    position: relative;
    z-index: 1;
}

.presence-avatar::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--dk-blurple) 0%, transparent 72%);
    opacity: .55;
    filter: blur(3px);
    animation: darkirella-presence-pulse 3.2s ease-in-out infinite;
}

@keyframes darkirella-presence-pulse {
    0%, 100% { opacity: .35; transform: scale(.94); }
    50%      { opacity: .65; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .presence-avatar::before { animation: none; }
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color .15s ease-in-out, transform .15s ease-in-out;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-1px);
    color: var(--dk-blurple) !important;
}

.navbar-divider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.navbar-divider {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.14);
    margin: 0 0.5rem;
}

.admin-badge {
    position: absolute;
    top: -0.65rem;
    left: 0;
    font-size: 0.6rem;
    background: linear-gradient(135deg, var(--dk-fuchsia), var(--dk-blurple));
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.toggler-icon {
    font-size: 1.1rem;
}

.dropdown-menu {
    border: 1px solid var(--bs-border-color);
}

.dropdown-menu .dropdown-item {
    border-radius: .5rem;
    transition: background-color .15s ease-in-out;
}

.dropdown-menu .dropdown-item:hover {
    background-color: rgba(88, 101, 242, 0.12);
}

/* ---- Bottom-Nav (Mobile) --------------------------------------------------
   Ersetzt auf kleinen Screens das Burger-Menue: max. 5 gleichwertige Ziele,
   die restlichen (Achievements verwalten, Timer, Dashboard, Logs) leben im
   "Mehr"-Offcanvas darunter statt als 6. Icon in der Leiste zu ueberlaufen.
------------------------------------------------------------------------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: var(--bottomnav-h);
    background-color: rgba(11, 13, 20, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bottom-nav .bn-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 6px 2px;
    transition: color .15s ease-in-out;
}

.bottom-nav .bn-link i {
    font-size: 1.25rem;
}

.bottom-nav .bn-link.active {
    color: var(--dk-blurple);
}

.bottom-nav-spacer {
    height: var(--bottomnav-h);
    flex-shrink: 0;
}

/* ---- Sticky Page-Header ----------------------------------------------------
   Folgt der tatsaechlichen Navbar-Hoehe (siehe --navbar-h in _Layout.cshtml).
------------------------------------------------------------------------- */

.page-sticky {
    position: sticky;
    top: var(--navbar-h);
    z-index: 1020;
}

/* ---- Seitentitel ---------------------------------------------------------- */

.page-title-leaderboard,
.page-title-quotes,
.page-title-drinks,
.page-title-timer,
.page-title-logs,
.page-title-birthdays,
.page-title-streak {
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.leaderboard-icon,
.quote-icon,
.drink-icon,
.timer-icon,
.logs-icon,
.birthday-icon,
.streak-icon,
.achievement-icon,
.dashboard-icon {
    font-size: 1.4rem;
    line-height: 1;
    color: var(--dk-blurple);
}

/* ---- Cards --------------------------------------------------------------
   Ruhige, klar umrissene Flaechen statt schwerer Schatten - passend zum
   "seriösen" Anspruch: 1px Border statt box-shadow, dezente Elevation nur
   auf echtem Hover (Maus), nicht als Dauerzustand.
------------------------------------------------------------------------- */

.card {
    border: 1px solid var(--bs-border-color);
}

.card-body {
    padding-top: 1.5rem;
}

.card footer {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #555);
}

.card.quote-card {
    border-radius: var(--bs-border-radius-lg) !important;
    background-color: #F5F7FF !important;
    border-left: 3px solid var(--dk-blurple);
    position: relative;
}

[data-bs-theme="dark"] .card.quote-card {
    background-color: rgba(88, 101, 242, 0.06) !important;
}

.drink-card {
    transition: transform .15s ease-in-out, border-color .15s ease-in-out;
}

/* Hover-Transform nur auf Geraeten mit echtem Hover (Maus) ausloesen, sonst
   bleibt der Effekt nach einem Tap auf Touch-Geraeten "haengen". */
@media (hover: hover) and (pointer: fine) {
    .card:hover,
    .drink-card:hover {
        transform: translateY(-2px);
        border-color: rgba(88, 101, 242, 0.4);
    }
}

.btn {
    font-weight: 500;
}

.btn i {
    vertical-align: middle;
}

.timer-table td {
    vertical-align: middle;
}

/* ---- Dark-Mode Hilfsklassen ----------------------------------------------- */

[data-bs-theme="dark"] .dark-bg-secondary {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

[data-bs-theme="dark"] .dark-text-light {
    color: #c7cadb !important;
}

[data-bs-theme="dark"] .dark-subtle {
    color: rgba(255, 255, 255, 0.55) !important;
}

/* ---- Leaderboard Easter-Egg ------------------------------------------------ */

.glitch-row {
    color: var(--dk-green);
    font-family: "JetBrains Mono", var(--bs-font-monospace);
    overflow: hidden;
}

.glitch-row td {
    animation: darkirella-glitch 2.4s infinite steps(2, end);
}

.glitch-bg {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(87, 242, 135, 0.06) 0px, rgba(87, 242, 135, 0.06) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
}

@keyframes darkirella-glitch {
    0%, 100% { transform: translate(0, 0); opacity: 1; }
    45% { transform: translate(1px, 0); opacity: .85; }
    50% { transform: translate(-1px, 0); opacity: 1; }
}

/* ---- Leaderboard: Karten statt Tabelle (mobile-first) -------------------- */

.rank-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--bs-border-radius);
}

.rank-row .rank-slot {
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    font-family: "JetBrains Mono", var(--bs-font-monospace);
}

.rank-row .rank-progress {
    flex: 1;
    min-width: 0;
}

/* Bootstrap liefert nur min-vw-100/min-vh-100 - kein generisches min-w-0.
   Wird in Leaderboard.cshtml gebraucht, damit lange Namen/Hex-Strings in
   Flex-Zeilen truncaten statt die Zeile auf Mobile zu sprengen. */
.min-w-0 {
    min-width: 0 !important;
}

/* ---- Progress-Bars: einheitlicher Blurple-Verlauf statt Ad-hoc-Inline-Gradients ---- */

.progress-bar {
    background: linear-gradient(90deg, var(--dk-blurple), #4facfe);
}

@media (max-width: 767.98px) {
    #mainNavbar .nav-item.dropdown .dropdown-menu {
        position: absolute;
        right: 0;
        left: auto;
    }
}

/* ---- Geburtstage: "Anstehend"-Karten ------------------------------------- */

.birthday-card {
    transition: transform .15s ease-in-out, border-color .15s ease-in-out;
}

@media (hover: hover) and (pointer: fine) {
    .birthday-card:hover {
        transform: translateY(-2px);
        border-color: rgba(88, 101, 242, 0.4);
    }
}

/* ---- Geburtstage: Monatskalender ------------------------------------------
   Reines CSS-Grid statt externer Kalender-Bibliothek, konsistent mit dem
   Rest der Seite (vanilla JS, kein zusaetzliches npm-Package). Prev/Next
   rendert bei Klick per JS einfach den naechsten/vorherigen Monat neu -
   das ist das "Scrollen" durch den Kalender.
------------------------------------------------------------------------- */

.birthday-calendar .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.birthday-calendar .cal-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bs-secondary-color, #777);
    padding-bottom: 4px;
}

.birthday-calendar .cal-cell {
    min-height: 72px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.birthday-calendar .cal-cell.cal-empty {
    border-color: transparent;
}

.birthday-calendar .cal-daynum {
    font-size: 0.75rem;
    font-family: "JetBrains Mono", var(--bs-font-monospace);
    color: var(--bs-secondary-color, #777);
}

.birthday-calendar .cal-cell.cal-today {
    border-color: var(--dk-blurple);
    box-shadow: inset 0 0 0 1px var(--dk-blurple);
}

.birthday-calendar .cal-cell.cal-today .cal-daynum {
    color: var(--dk-blurple);
    font-weight: 700;
}

.birthday-calendar .cal-cell.cal-has-birthday {
    background-color: rgba(88, 101, 242, 0.08);
}

.birthday-calendar .cal-birthday {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    line-height: 1.1;
    background-color: rgba(88, 101, 242, 0.14);
    border-radius: 999px;
    padding: 1px 6px 1px 1px;
}

.birthday-calendar .cal-birthday img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.birthday-calendar .cal-birthday-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .birthday-calendar .cal-cell {
        min-height: 54px;
    }

    .birthday-calendar .cal-birthday-name {
        display: none;
    }
}
/* ---- Streak-Liste --------------------------------------------------------
   Inline-editierbare Felder (form-control-plaintext) sehen wie normaler
   Text aus; erst Fokus/Hover deutet an, dass sie editierbar sind.
------------------------------------------------------------------------- */

.streak-username-input,
.streak-count-input {
    cursor: text;
    border-radius: .375rem;
    transition: background-color .15s ease-in-out;
}

.streak-username-input:hover,
.streak-count-input:hover {
    background-color: rgba(88, 101, 242, 0.08);
}

.streak-stepper {
    max-width: 160px;
}

.streak-count-input {
    -moz-appearance: textfield;
}

.streak-count-badge {
    font-size: .8rem;
    font-weight: 500;
}

.streak-discord-select {
    max-width: 160px;
}

@media (max-width: 575.98px) {
    .streak-discord-select {
        max-width: 110px;
    }
}
