/* ============================================================================
   SITE HEADER - Ciblu Branded Header
   ============================================================================ */

.site-header {
    background: linear-gradient(135deg, var(--ciblu-primary) 0%, var(--ciblu-primary-800) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo & Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    text-decoration: none;
}

.header-brand:hover {
    color: white;
    text-decoration: none;
}

.header-logo {
    height: 44px;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 100%;
    width: auto;
    filter: brightness(0) invert(1); /* Make logo white */
}

.header-brand-divider {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.3);
}

.header-brand-product {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    opacity: 0.95;
}

/* Main Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.header-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
}

.header-nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-nav-link .nav-icon {
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Menu */
.header-user {
    position: relative;
}

.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: white;
    color: var(--ciblu-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: white;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.75rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background-color: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    z-index: 200;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.125rem;
    background-color: var(--surface-alt);
}

.dropdown-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--ciblu-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.dropdown-user-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: var(--surface-alt);
    text-decoration: none;
    color: var(--text-primary);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background-color: rgba(var(--danger-rgb), 0.08);
    color: var(--danger);
}

.dropdown-section-title {
    padding: 0.5rem 1.125rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-icon {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
}

/* ============================================================================
   SITE CONTENT
   ============================================================================ */

.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    padding: 2rem 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================================
   AUTH LAYOUT - Login, Register, ForgotPassword, etc.
   ============================================================================ */

.auth-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background);
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-container:has(.legal-content) {
    max-width: 720px;
}

/* ============================================================================
   LEGAL PAGES - Impressum, Datenschutz
   D6: Own CSS class instead of .card — legal texts need wider layout (720px vs 400px)
   D7: 720px max-width for optimal reading width (~65-80 chars/line at 16px)
   D8: Global CSS (not scoped) — consistent with other layout classes
   D9: Semantic styling via .legal-content scope — keeps Razor files clean
   ============================================================================ */

.legal-content {
    width: 100%;
    max-width: 720px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-sm);
}

.legal-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.legal-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
}

.legal-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.legal-content ul {
    padding-left: 1.5rem;
    margin: 0 0 0.75rem;
}

.legal-content ul li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.25rem;
}

.legal-content a {
    color: var(--ciblu-primary-text);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--ciblu-primary-text-hover);
}

.legal-content address {
    font-style: normal;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.legal-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-content .legal-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

.legal-content .legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9375rem;
}

.legal-content .legal-table th,
.legal-content .legal-table td {
    border: 1px solid var(--border);
    padding: 0.625rem 0.75rem;
    text-align: left;
    color: var(--text-primary);
}

.legal-content .legal-table th {
    background-color: var(--surface-secondary);
    font-weight: 600;
}

.legal-content .legal-table code {
    background-color: var(--surface-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.5rem 1.25rem;
    }

    .legal-content .legal-table {
        font-size: 0.8125rem;
    }

    .legal-content .legal-table th,
    .legal-content .legal-table td {
        padding: 0.5rem;
    }
}

/* ============================================================================
   SITE FOOTER
   ============================================================================ */

.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-container a {
    color: var(--text-secondary);
}

.footer-container a:hover {
    color: var(--ciblu-primary-text);
}

.footer-separator {
    opacity: 0.5;
}
