/* ============================================================
   jt-online Haupt-Stylesheet
   Kleinwasserkraft Oesterreich - Jahrestagung Online
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ------------------------------------------------------------
   CSS Custom Properties (Corporate Design)
   ------------------------------------------------------------ */
:root {
    --jt-blue:        #1C518B;
    --jt-light-blue:  #2297C6;
    --jt-turquoise:   #26D8C3;
    --jt-blue-dark:   #163f6d;
    --jt-bg:          #f4f7fb;
    --jt-white:       #ffffff;
    --jt-text:        #1a2233;
    --jt-text-muted:  #6c757d;
    --jt-border:      #d1dce8;
    --jt-shadow:      0 2px 12px rgba(28, 81, 139, 0.10);
    --jt-shadow-lg:   0 8px 32px rgba(28, 81, 139, 0.16);
    --jt-radius:      10px;
    --jt-radius-lg:   16px;
    --jt-font:        'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--jt-font);
    background-color: var(--jt-bg);
    color: var(--jt-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--jt-light-blue);
    text-decoration: none;
}

a:hover {
    color: var(--jt-blue);
    text-decoration: underline;
}

/* ------------------------------------------------------------
   Navbar
   ------------------------------------------------------------ */
.navbar-jt {
    background: linear-gradient(135deg, var(--jt-blue) 0%, var(--jt-light-blue) 100%);
    box-shadow: 0 2px 16px rgba(28, 81, 139, 0.25);
    padding: 0.75rem 0;
}

.navbar-jt .navbar-brand {
    color: var(--jt-white) !important;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
}

.navbar-jt .navbar-brand .brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-jt .navbar-brand img {
    height: 36px;
    margin-right: 10px;
}

.navbar-jt .nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}

.navbar-jt .nav-link:hover,
.navbar-jt .nav-link.active {
    color: var(--jt-white) !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.4);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ------------------------------------------------------------
   Hero / Live-Anzeige
   ------------------------------------------------------------ */
.hero-live {
    background: linear-gradient(135deg, var(--jt-blue) 0%, var(--jt-light-blue) 60%, var(--jt-turquoise) 100%);
    color: var(--jt-white);
    padding: 3rem 0 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero-live::before {
    content: '';
    position: absolute;
    top: -60px; right: -80px;
    width: 340px; height: 340px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.hero-live::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -60px;
    width: 220px; height: 220px;
    background: rgba(38, 216, 195, 0.12);
    border-radius: 50%;
}

.hero-live .container {
    position: relative;
    z-index: 1;
}

.hero-live .live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hero-live .live-badge .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--jt-turquoise);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero-live h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.hero-live .type-badge {
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.88;
    margin-bottom: 0.5rem;
}

.hero-live .speaker-name {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.hero-live .time-display {
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-next {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--jt-radius);
    padding: 0.75rem 1.1rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

/* ------------------------------------------------------------
   Karten (Cards)
   ------------------------------------------------------------ */
.card-jt {
    background: var(--jt-white);
    border: 1px solid var(--jt-border);
    border-radius: var(--jt-radius-lg);
    box-shadow: var(--jt-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.card-jt:hover {
    box-shadow: var(--jt-shadow-lg);
    transform: translateY(-2px);
}

/* ------------------------------------------------------------
   Programm-Ansicht
   ------------------------------------------------------------ */
.day-section {
    margin-bottom: 2.5rem;
}

.day-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--jt-blue);
    border-bottom: 3px solid var(--jt-light-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}

.program-item {
    display: flex;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: var(--jt-white);
    border: 1px solid var(--jt-border);
    border-left: 4px solid var(--jt-light-blue);
    border-radius: var(--jt-radius);
    margin-bottom: 0.6rem;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.program-item:hover {
    border-left-color: var(--jt-blue);
    box-shadow: var(--jt-shadow);
}

.program-item.type-vortrag    { border-left-color: var(--jt-blue); }
.program-item.type-exkursion  { border-left-color: var(--jt-turquoise); }
.program-item.type-verpflegung{ border-left-color: #f0a500; }
.program-item.type-sonstiges  { border-left-color: #adb5bd; }
.program-item.is-current      { background: #eaf6ff; border-left-color: var(--jt-light-blue); box-shadow: var(--jt-shadow); }

.program-time {
    min-width: 90px;
    font-size: 0.85rem;
    color: var(--jt-text-muted);
    font-weight: 500;
    padding-top: 2px;
}

.program-body { flex: 1; }

.program-title {
    font-weight: 600;
    font-size: 0.975rem;
    margin-bottom: 2px;
}

.program-speaker {
    font-size: 0.845rem;
    color: var(--jt-text-muted);
}

/* Typ-Badges */
.badge-vortrag     { background: var(--jt-blue);      color: #fff; }
.badge-exkursion   { background: var(--jt-turquoise); color: #fff; }
.badge-verpflegung { background: #f0a500;              color: #fff; }
.badge-sonstiges   { background: #adb5bd;              color: #fff; }

/* ------------------------------------------------------------
   Speaker-Karten
   ------------------------------------------------------------ */
.speaker-card {
    background: var(--jt-white);
    border: 1px solid var(--jt-border);
    border-radius: var(--jt-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--jt-shadow);
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
}

.speaker-card:hover {
    box-shadow: var(--jt-shadow-lg);
    transform: translateY(-3px);
}

.speaker-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--jt-light-blue);
    margin-bottom: 1rem;
}

.speaker-photo-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--jt-blue), var(--jt-light-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.speaker-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--jt-blue);
    margin-bottom: 0.4rem;
}

.speaker-bio {
    font-size: 0.875rem;
    color: var(--jt-text-muted);
    line-height: 1.6;
}

/* ------------------------------------------------------------
   Sponsoren
   ------------------------------------------------------------ */
.sponsor-category-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--jt-blue);
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.sponsor-category-heading::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--jt-turquoise);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.sponsor-card {
    background: var(--jt-white);
    border: 1px solid var(--jt-border);
    border-radius: var(--jt-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--jt-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.sponsor-card:hover {
    box-shadow: var(--jt-shadow-lg);
    transform: translateY(-3px);
}

.sponsor-logo {
    max-height: 80px;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 0.85rem;
}

.sponsor-name {
    font-weight: 600;
    color: var(--jt-blue);
    margin-bottom: 0.4rem;
}

.sponsor-desc {
    font-size: 0.845rem;
    color: var(--jt-text-muted);
    line-height: 1.6;
}

.btn-sponsor-website {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--jt-light-blue);
    border: 1px solid var(--jt-light-blue);
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}

.btn-sponsor-website:hover {
    background: var(--jt-light-blue);
    color: #fff;
    text-decoration: none;
}

/* ------------------------------------------------------------
   Downloads
   ------------------------------------------------------------ */
.download-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--jt-white);
    border: 1px solid var(--jt-border);
    border-radius: var(--jt-radius);
    padding: 0.9rem 1.2rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: var(--jt-text);
    transition: border-color 0.18s, box-shadow 0.18s;
}

.download-item:hover {
    border-color: var(--jt-light-blue);
    box-shadow: var(--jt-shadow);
    color: var(--jt-text);
}

.download-icon {
    font-size: 1.6rem;
    color: var(--jt-light-blue);
    flex-shrink: 0;
}

.download-title {
    font-weight: 500;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------
   Chat
   ------------------------------------------------------------ */
#chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 280px);
    min-height: 380px;
    max-height: 640px;
    background: var(--jt-white);
    border: 1px solid var(--jt-border);
    border-radius: var(--jt-radius-lg);
    overflow: hidden;
    box-shadow: var(--jt-shadow);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

.chat-message {
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--jt-bg);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.chat-message.highlighted {
    background: rgba(38, 216, 195, 0.12);
    border-left-color: var(--jt-turquoise);
}

.chat-message.speaker-reply {
    background: rgba(28, 81, 139, 0.07);
    border-left-color: var(--jt-blue);
}

/* Reply-Blockquote (Originalnachricht bei Antworten) */
.reply-quote {
    border-left: 3px solid var(--jt-light-blue);
    background: rgba(34, 151, 198, 0.08);
    margin: 0 0 8px 0;
    padding: 6px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reply-quote-author {
    font-weight: 600;
    color: var(--jt-blue);
}

.reply-quote-text {
    color: var(--jt-text-muted);
    font-style: italic;
}

.chat-message.speaker-reply .reply-quote {
    border-left-color: var(--jt-blue);
    background: rgba(28, 81, 139, 0.10);
}

/* Programmpunkt-Tag auf Nachrichten */
.msg-program-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(28, 81, 139, 0.10);
    color: var(--jt-blue);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.msg-program-tag i {
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* Antworten-Button fuer Referenten */
.btn-reply {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--jt-border);
    color: var(--jt-light-blue);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    margin-top: 6px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.btn-reply:hover {
    background: rgba(34, 151, 198, 0.1);
    border-color: var(--jt-light-blue);
}

.chat-message .msg-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.chat-message .msg-author {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--jt-blue);
}

.chat-message .msg-author.anonymous {
    color: var(--jt-text-muted);
}

.chat-message .msg-time {
    font-size: 0.75rem;
    color: var(--jt-text-muted);
    margin-left: auto;
}

.chat-message .msg-text {
    color: var(--jt-text);
    line-height: 1.5;
    word-break: break-word;
}

.speaker-badge {
    background: var(--jt-blue);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

#chat-input-area {
    border-top: 1px solid var(--jt-border);
    padding: 0.75rem 1rem;
    background: var(--jt-white);
}

#chat-input-area .input-group {
    gap: 6px;
}

#chat-name-input {
    max-width: 160px;
    font-size: 0.875rem;
}

#chat-message-input {
    font-size: 0.875rem;
    resize: none;
}

.btn-chat-send {
    background: var(--jt-light-blue);
    border-color: var(--jt-light-blue);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.btn-chat-send:hover {
    background: var(--jt-blue);
    border-color: var(--jt-blue);
    color: #fff;
}

.chat-disabled-notice {
    text-align: center;
    padding: 2rem;
    color: var(--jt-text-muted);
    font-style: italic;
}

/* ------------------------------------------------------------
   Goodbye-Seite
   ------------------------------------------------------------ */
.goodbye-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--jt-blue) 0%, var(--jt-light-blue) 60%, var(--jt-turquoise) 100%);
    text-align: center;
    color: var(--jt-white);
    padding: 2rem;
}

.goodbye-content h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.goodbye-content p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 560px;
    margin: 0 auto;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer-jt {
    background: var(--jt-blue);
    color: rgba(255,255,255,0.75);
    padding: 1.25rem 0;
    font-size: 0.85rem;
    margin-top: auto;
}

.footer-jt a {
    color: rgba(255,255,255,0.5);
    transition: color 0.18s;
}

.footer-jt a:hover {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
}

.footer-admin-link {
    font-size: 0.75rem;
    opacity: 0.45;
}

/* ------------------------------------------------------------
   Buttons (Bootstrap-Override)
   ------------------------------------------------------------ */
.btn-jt-primary {
    background: var(--jt-blue);
    border-color: var(--jt-blue);
    color: #fff;
    font-weight: 500;
}

.btn-jt-primary:hover {
    background: var(--jt-blue-dark);
    border-color: var(--jt-blue-dark);
    color: #fff;
}

.btn-jt-secondary {
    background: var(--jt-light-blue);
    border-color: var(--jt-light-blue);
    color: #fff;
    font-weight: 500;
}

.btn-jt-secondary:hover {
    background: var(--jt-blue);
    border-color: var(--jt-blue);
    color: #fff;
}

/* ------------------------------------------------------------
   Hilfselemente
   ------------------------------------------------------------ */
.section-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--jt-blue);
    margin-bottom: 1.75rem;
}

.section-heading::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background: linear-gradient(to right, var(--jt-light-blue), var(--jt-turquoise));
    margin-top: 0.4rem;
    border-radius: 2px;
}

.text-jt-blue       { color: var(--jt-blue) !important; }
.text-jt-light-blue { color: var(--jt-light-blue) !important; }
.text-jt-turquoise  { color: var(--jt-turquoise) !important; }
.bg-jt-blue         { background-color: var(--jt-blue) !important; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 576px) {
    .program-item { flex-direction: column; gap: 0.25rem; }
    .program-time  { min-width: unset; }
    #chat-name-input { max-width: 110px; }
}

/* ------------------------------------------------------------
   Bottom Navigation Bar (nur Mobile)
   ------------------------------------------------------------ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--jt-white);
    border-top: 1px solid var(--jt-border);
    display: flex;
    box-shadow: 0 -2px 12px rgba(28, 81, 139, 0.10);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.5rem 0.25rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    text-decoration: none;
    color: var(--jt-text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 1.35rem;
    line-height: 1;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--jt-light-blue);
    text-decoration: none;
}

.bottom-nav-item.active i {
    color: var(--jt-blue);
}

/* Body-Abstand damit Content nicht hinter der Bottom Nav verschwindet */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 72px;
    }
}

/* Auf mobilen Screens Brand-Text ausblenden (Logo enthält den Namen) */
@media (max-width: 575.98px) {
    .brand-text {
        display: none;
    }
    .navbar-jt .navbar-brand img {
        height: 32px;
        margin-right: 0;
    }
}

/* Sehr kleine Screens: Bottom Nav kompakter */
@media (max-width: 380px) {
    .bottom-nav-item {
        padding: 0.35rem 0.1rem;
        padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
        font-size: 0.58rem;
        gap: 2px;
    }
    .bottom-nav-item i {
        font-size: 1.1rem;
    }
}

/* ------------------------------------------------------------
   Mobile Navigation Grid (nur Startseite, nur Mobile)
   ------------------------------------------------------------ */
.mobile-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 0.75rem;
}

.mobile-nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 1.25rem 0.5rem;
    text-decoration: none;
    color: var(--jt-blue);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(28,81,139,.08);
    transition: border-color .15s, box-shadow .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-tile i {
    font-size: 2rem;
    color: var(--jt-light-blue);
}

.mobile-nav-tile:hover,
.mobile-nav-tile:active {
    border-color: var(--jt-light-blue);
    box-shadow: 0 4px 14px rgba(34,151,198,.18);
    transform: translateY(-2px);
    color: var(--jt-blue);
}
