:root {
    /* Color Palette - Dark/Tech Theme */
    --bg-color: #0f172a; /* Dark Slate 900 */
    --text-color: #e2e8f0; /* Slate 200 */
    --header-bg: rgba(15, 23, 42, 0.95); /* Semi-transparent Dark */
    --header-text: #f8f9fa;
    --card-bg: #1e293b; /* Slate 800 */
    --primary-color: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb; /* Blue 600 */
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --border-color: #334155; /* Slate 700 */
    --hero-gradient-start: #0f172a;
    --hero-gradient-end: #1e293b;
    --accent-color: #06b6d4; /* Cyan for tech accents */
}

[data-theme="light"] {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --header-bg: #0f172a;
    --card-bg: #ffffff;
    --primary-color: #2563eb;
    --border-color: #e2e8f0;
    --hero-gradient-start: #0f172a;
    --hero-gradient-end: #1e293b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 0.75rem 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s;
}

header.header-transparent {
    background-color: var(--header-bg); /* Use consistent background */
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav {
    justify-self: center;
}

.header-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.header-nav a {
    color: #94a3b8; /* Slate 400 */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 6px;
}

.header-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.header-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

/* Hide mobile auth items on desktop */
.mobile-auth-item {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Search Bar in Header */
.header-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.2);
}

.header-search input {
    background: #fff;
    border: none;
    color: #333;
    outline: none;
    width: 200px;
    font-size: 0.9rem;
    padding: 8px 12px;
    margin: 0;
    border-radius: 4px;
}

.header-search input::placeholder {
    color: #64748b;
}

.header-search button {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search button:hover {
    color: #fff;
}

/* User Dropdown */
.header-user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #cbd5e1;
    font-weight: 500;
    padding-bottom: 10px; /* Bridge the gap */
    margin-bottom: -10px; /* Compensate layout */
}

.header-user-menu:hover {
    color: #fff;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0; /* Remove margin to ensure overlap/connection */
    padding-top: 10px; /* Move content down inside */
    background-color: transparent; /* Wrapper is transparent */
    min-width: 200px;
    display: none;
    z-index: 1000;
    flex-direction: column;
}

.user-dropdown-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 5px 0;
    display: flex;
    flex-direction: column;
}

.header-user-menu:hover .user-dropdown {
    display: flex;
}

.user-dropdown a {
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.user-dropdown a:hover {
    background-color: var(--secondary-bg);
    color: var(--primary-color);
}

.user-dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

/* Notification Badge in Dropdown */
.notif-badge {
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: auto;
}

/* --- Utilities --- */
.text-primary { color: var(--primary-color); }
.text-danger { color: #ef4444; }
.text-success { color: #22c55e; }
.text-warning { color: #f59e0b; }
.text-muted { color: #94a3b8; }

.brand-text {
    font-weight: 800;
    letter-spacing: -0.5px;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-dot {
    background-color: #ef4444;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: #fff;
    border-radius: 16px; /* More rounded */
    padding: 5rem 3rem;
    margin: 0 0 2rem 0;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2); /* Stronger shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-content {
    max-width: 600px;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem; /* Larger */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.hero-subline {
    font-size: 1.25rem;
    color: #94a3b8; /* Slate 400 */
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-icon {
    font-size: 20rem; /* Huge */
    color: rgba(255, 255, 255, 0.03); /* Very subtle */
    position: absolute;
    right: -5rem;
    bottom: -5rem;
    transform: rotate(-10deg);
    z-index: 1;
    pointer-events: none;
}

/* --- Feature Grid --- */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First: 1 Column */
    gap: 40px; /* Increased gap */
    row-gap: 50px; /* Increased vertical gap */
    margin-top: 50px;
    margin-bottom: 120px; /* More space at bottom for footer */
    width: 100%;
    position: relative;
    z-index: 10; /* Ensure above hero shadow */
}

@media (min-width: 700px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr); /* Tablet: 2 Columns */
    }
}

@media (min-width: 1100px) {
    .feature-grid {
        grid-template-columns: repeat(4, 1fr); /* Desktop: 4 Columns */
    }
}

.feature-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    padding: 2rem;
    min-width: 0;
}

/* Ensure specificity overrides generic .card */
.feature-grid .card {
    margin-bottom: 0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    width: fit-content;
}

.feature-forum .card-icon { color: var(--primary-color); background: rgba(59, 130, 246, 0.1); }
.feature-errors .card-icon { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.feature-calc .card-icon { color: #10b981; background: rgba(16, 185, 129, 0.1); }

.card-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.card-content p {
    flex-grow: 1;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
    cursor: pointer;
    border: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.btn-text {
    background: none;
    color: #cbd5e1;
    padding: 5px 10px;
}

.btn-text:hover {
    color: #fff;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #64748b;
    color: #fff;
}
.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: #22c55e;
    color: #fff;
}
.btn-success:hover {
    background-color: #16a34a;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1; /* Pushes footer down */
    width: 100%; /* Ensure full width in flex container */
    box-sizing: border-box;
}

.card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* Forms */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Calculator Specific */
/* Calculator Jump Marks */
.calc-nav-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calc-nav-badge:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.calc-card {
    background: linear-gradient(145deg, var(--card-bg), rgba(255,255,255,0.02));
    padding: 1.75rem;
    border-radius: 16px; /* Softer corners */
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.calc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color); /* Subtle highlighting */
}

/* Optional: Add a subtle top highlight line */
.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.calc-card:hover::before {
    opacity: 1;
}

.calc-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Highlight target calculator */
.calc-card:target {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); /* Blue shadow/glow */
    animation: highlight-pulse 1.5s ease-out;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }
}

.calc-input-group {
    margin-bottom: 15px;
}

.calc-input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #64748b;
}

[data-theme="dark"] .calc-input-group label {
    color: #94a3b8;
}

.calc-input-group input,
.calc-input-group select {
    background-color: rgba(0, 0, 0, 0.2); /* Darker input bg for contrast */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
}

.calc-input-group input:focus,
.calc-input-group select:focus {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.calc-result {
    background: rgba(15, 23, 42, 0.6); /* Darker bg */
    border: 1px solid rgba(59, 130, 246, 0.3); /* Blueish border */
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Consolas', 'Monaco', monospace; /* Tech look */
    font-size: 1.2rem;
    text-align: right; /* Digital display style */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="light"] .calc-result {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* --- Footer --- */
footer {
    background-color: var(--header-bg); /* Dark background like header */
    color: #94a3b8; /* Muted text color */
    padding: 2rem 2rem; /* Reduced padding top/bottom */
    margin-top: auto; /* Ensure it stays at bottom if flex fails or just good practice */
    border-top: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(10px); /* Optional: adds blur effect behind footer content */
    transition: transform 0.3s ease-in-out;
}

.footer-toggle-btn {
    display: flex;
    position: absolute;
    top: -30px;
    right: 20px;
    background-color: var(--header-bg);
    color: #fff;
    width: 40px;
    height: 30px;
    border-radius: 8px 8px 0 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

footer {
    transform: translateY(90%); /* Hide most of footer initially */
}

footer.active {
    transform: translateY(0);
}

footer.active .footer-toggle-btn i {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    /* Mobile specific adjustments if any */
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 150px; /* Increased height as requested */
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 90; /* Below footer z-index */
}

.scroll-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(0) scale(1.1);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px; /* Reduced gap */
    text-align: left;
}

.footer-brand h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 10px; /* Reduced margin */
    font-size: 1.15rem; /* Slightly smaller */
}

.footer-brand p {
    line-height: 1.5;
    margin-bottom: 0;
    font-size: 0.9rem; /* Smaller text */
}

.footer-col h4 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 15px; /* Reduced margin */
    font-size: 0.95rem; /* Slightly smaller */
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 8px; /* Reduced margin */
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem; /* Smaller text */
}

.footer-col ul li a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0; /* Reduced margin top */
    padding-top: 1.5rem; /* Reduced padding */
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem; /* Smaller text */
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Footer Close Button */
.footer-close-btn {
    display: none; /* Hidden by default */
    position: absolute;
    top: 40px; /* Moved down another 10px */
    right: 20px;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
}

/* Only show when footer is active (open) */
footer.active .footer-close-btn {
    display: block;
}

/* Editor (Existing) */
.tk-editor-toolbar {
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 5px;
    background-color: var(--bg-color);
    border-radius: 5px 5px 0 0;
}
.tk-editor-content {
    border: 1px solid var(--border-color);
    min-height: 200px;
    padding: 10px;
    border-radius: 0 0 5px 5px;
    outline: none;
}

/* --- Admin Panel --- */
.admin-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
    margin-bottom: 50px;
}

.admin-sidebar {
    background-color: var(--header-bg);
    color: var(--header-text);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 20px;
}

.admin-sidebar-header {
    padding: 1.5rem;
    background-color: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.admin-nav-item {
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.admin-nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
}

.admin-nav-item.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--primary-color);
}

.admin-content h2 {
    margin-top: 0;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* Admin Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    background-color: var(--bg-color);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef9c3; color: #854d0e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-info { background-color: #dbeafe; color: #1e40af; }

[data-theme="dark"] .badge-success { background-color: rgba(22, 163, 74, 0.2); color: #4ade80; }
[data-theme="dark"] .badge-warning { background-color: rgba(234, 179, 8, 0.2); color: #facc15; }
[data-theme="dark"] .badge-danger { background-color: rgba(220, 38, 38, 0.2); color: #f87171; }
[data-theme="dark"] .badge-info { background-color: rgba(37, 99, 235, 0.2); color: #60a5fa; }

@media (max-width: 768px) {
    .admin-container {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
        margin-bottom: 20px;
    }
}

/* --- Mobile Navigation --- */

/* Toggle Button (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}

.mobile-menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--header-text);
    border-radius: 3px;
}

/* Mobile Header Layout */
@media (max-width: 768px) {
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .mobile-menu-toggle {
        display: block;
        order: 3;
        margin-left: 10px;
    }

    .header-actions {
        order: 2;
        margin-left: auto; /* Push actions to the right */
        gap: 10px;
    }
    
    .logo {
        order: 1;
    }

    .header-nav {
        display: none;
        width: 100%;
        order: 4;
        margin-top: 15px;
        background-color: var(--header-bg);
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .header-nav.active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .header-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .header-nav a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-radius: 0;
    }
    
    /* Hamburger Animation */
    .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Show mobile auth items */
    .mobile-auth-item {
        display: block;
    }
    
    .mobile-auth-item a {
        color: var(--primary-color) !important;
        font-weight: 600;
    }

    /* Hide desktop auth buttons in actions, but keep user menu if logged in */
    .header-actions > .btn, 
    .header-actions > .btn-text {
        display: none;
    }
}

/* Text Links with Tooltip */
.text-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px dashed var(--primary-color); /* Auffälliger gestrichelt */
    background-color: rgba(59, 130, 246, 0.1); /* Leichter Hintergrund */
    padding: 0 4px; /* Etwas Abstand */
    border-radius: 4px;
    position: relative;
    cursor: help;
    transition: all 0.2s;
    font-weight: 500;
}

.text-link:hover {
    color: #fff;
    background-color: var(--primary-color); /* Volle Farbe bei Hover */
    border-bottom-style: solid;
    text-decoration: none;
}

/* Tooltip */
.text-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: #ffffff; /* Weisser Hintergrund */
    color: #0f172a; /* Dunkle Schrift */
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-color); /* Blauer Rand */
    z-index: 1000;
    pointer-events: none;
    min-width: 220px;
    max-width: 320px;
    text-align: center;
    line-height: 1.5;
    font-weight: 500;
}

.text-link[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* Arrow for Tooltip */
.text-link[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-7px); /* Position angepasst an Border */
    border-width: 6px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent; /* Pfeil bleibt in Border-Farbe als Akzent */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.text-link[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-1px);
}

/* --- Social Share Buttons --- */
.social-share-container {
    margin: 20px 0;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--btn-color); /* Fallback */
    background-color: rgba(255, 255, 255, 0.05); /* Default subtle */
    color: var(--btn-color);
    border: 1px solid var(--btn-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.share-btn:hover {
    background-color: var(--btn-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

[data-theme="dark"] .share-btn {
    background-color: rgba(0,0,0,0.2);
}

[data-theme="dark"] .share-btn:hover {
    background-color: var(--btn-color);
}
