/* Gemeinsame Styles */
:root {
    --primary: #1a8f3c;
    --primary-dark: #146e2e;
    --primary-light: #2bb85a;
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-hover: #252835;
    --text: #e8e8ec;
    --text-muted: #8b8d97;
    --border: #2a2d3a;
    --danger: #d44040;
    --warning: #e6a817;
    --info: #3b82f6;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    padding: 8px 16px;
    transition: background 0.15s, transform 0.1s;
}

button:active {
    transform: scale(0.97);
}

input, select, textarea {
    font-family: inherit;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

/* ===== Gemeinsame Navigation ===== */

.site-nav {
    background: #1e2130;
    border-bottom: 1px solid #353848;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0;
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: #e8e8ec;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    margin-right: 28px;
    letter-spacing: -0.3px;
}

.nav-brand svg {
    flex-shrink: 0;
}

.nav-logo-wrap {
    height: 68px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 68px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: stretch;
    gap: 0;
    list-style: none;
    height: 100%;
    flex: 1;
}

.nav-links a {
    color: #a0a3b0;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 0 18px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #e8e8ec;
}

.nav-links a.active {
    color: #e8e8ec;
    border-bottom-color: var(--primary-light);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav-divider {
    width: 1px;
    height: 22px;
    background: #353848;
}

.nav-connection {
    display: none; /* nicht mehr als eigenes Element verwendet */
}

.nav-user-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c0c2cc;
    font-size: 13px;
}

.nav-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.nav-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

.btn-logout {
    background: transparent;
    color: #a0a3b0;
    font-size: 13px;
    padding: 5px 10px;
    border: 1px solid #353848;
    border-radius: var(--radius);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(212, 64, 64, 0.08);
}

.btn-new-drill {
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: background 0.15s;
    box-shadow: 0 1px 4px rgba(26,143,60,0.3);
}

.btn-new-drill:hover {
    background: var(--primary-light);
}

/* Hamburger Menu (Mobil) */
.nav-hamburger {
    display: none;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    padding: 4px;
    line-height: 1;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px 16px 16px;
        gap: 2px;
        box-shadow: var(--shadow);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 14px;
        width: 100%;
    }

    .nav-user-name {
        display: none;
    }
}

/* ===== Site Footer ===== */

.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: auto;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer a:hover {
    color: var(--primary);
}

.site-footer .footer-sep {
    opacity: 0.3;
}

/* ===== Toast Messages ===== */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--primary);
}

.toast.error {
    border-color: var(--danger);
}

/* ===== Page Layout Helper ===== */

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1;
}
