/* assets/css/style.css */

:root {
    /* --- CORE COLORS (Bleiben meist gleich) --- */
    --primary-color: #151e2c;
    --accent-color: #00C6B3;  /* Türkis */
    --gradient: linear-gradient(135deg, #00C6B3 0%, #009D8E 100%);
    
    /* --- DYNAMIC COLORS (Light Mode Default) --- */
    --bg-body: #F8FAFC;       /* Heller Hintergrund */
    --bg-card: #FFFFFF;       /* Weiße Karten */
    --bg-input: #FFFFFF;      /* Weiße Inputs */
    --text-main: #2D3748;     /* Dunkler Text */
    --text-muted: #64748b;    /* Grauer Text */
    --border-color: #e2e8f0;  /* Helle Rahmen */
    
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --hero-image-url: url('https://images.unsplash.com/photo-1518770660439-4636190af475?q=80&w=2070&auto=format&fit=crop');
}

/* --- DARK MODE OVERRIDES --- */
[data-theme="dark"] {
    /* NEU: Dein gewünschter violetterer Hintergrund */
    --bg-body: #1b172c;
    
    /* Der Rest bleibt wie gehabt, da dir das Zusammenspiel gefällt */
    --bg-card: #1e293b;       /* Slate 800 (Bläuliches Grau) */
    --bg-input: #0f172a;      /* Slate 900 */
    --text-main: #f1f5f9;     /* Slate 100 (Fast Weiß) */
    --text-muted: #94a3b8;    /* Slate 400 */
    --border-color: #334155;  /* Slate 700 */
    
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    /* Sanfter Übergang beim Umschalten */
    transition: background-color 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
.main-header {
    background: var(--primary-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10000;
    height: 70px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    gap: 1.5rem;
}

.logo {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-highlight {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
    margin: 0 auto;
    padding: 0;
    height: 100%;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* --- NAVIGATION DROPDOWN (AI Menu) --- */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    min-width: 200px;
    padding: 0.5rem 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-top: 2px solid var(--accent-color);
    z-index: 10001;
    list-style: none;
}

.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown:focus-within .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-menu .dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.dropdown-menu .dropdown-link:hover {
    background-color: var(--accent-color);
    color: white;
}

/* =========================================
   ACTIONS & USER AREA
   ========================================= */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    position: relative;
}

.nav-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: color 0.3s ease, background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.nav-action-btn:hover {
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.cta-button {
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    box-shadow: 0 0 15px 5px rgba(0, 198, 179, 0.3);
    transform: translateY(-1px);
}

/* Notifications */
.notifications-toggle-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* User Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-toggle-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: inherit;
}

.profile-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-username-short {
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--primary-color);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 200px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    border-top: 2px solid var(--accent-color);
}

.profile-dropdown:hover .profile-dropdown-menu {
    display: block;
}

.profile-dropdown-menu .dropdown-header {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.profile-dropdown-menu .dropdown-header strong {
    color: white;
    display: block;
}

.profile-dropdown-menu .dropdown-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.1);
    border: none;
    margin: 0.5rem 0;
}

.profile-dropdown-menu .dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.profile-dropdown-menu .dropdown-link:hover {
    background-color: var(--accent-color);
    color: white;
}

/* --- SETTINGS DROPDOWN --- */
.settings-container {
    position: relative;
}

.settings-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: -50px;
    width: 260px;
    background-color: var(--bg-card);
    color: var(--text-main);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 10002;
    padding: 1rem;
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.3s ease;
}

.settings-panel.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.close-btn:hover {
    color: var(--accent-color);
}

.settings-group {
    margin-bottom: 1rem;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group-title {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.settings-options {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-body);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.option-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 0.4rem;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.option-btn:hover {
    color: var(--text-main);
}

.option-btn.active {
    background-color: var(--bg-card);
    color: var(--accent-color);
    box-shadow: var(--shadow);
    font-weight: 600;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background: white;
    transition: all 0.3s ease;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero-section {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0 3rem 0;
    background-image: linear-gradient(rgba(26, 30, 38, 0.85), rgba(26, 30, 38, 0.95)), var(--hero-image-url);
    background-size: cover;
    background-position: center;
    text-align: center;
}

.hero-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* =========================================
   MAIN CONTENT & CARDS
   ========================================= */
.featured-section {
    padding: 4rem 0;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    /* FIX: Verwende Standard-Farbe im Light Mode (#1A1E26), aber dynamisch im Dark Mode */
    color: var(--primary-color);
    font-weight: 700;
}

/* FIX: Im Dark Mode die Überschriften hell machen */
[data-theme="dark"] .section-title {
    color: var(--text-main);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.featured-article {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.featured-article:hover {
    transform: translateY(-5px);
}

.article-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-article:hover .article-image img {
    transform: scale(1.05);
}

.article-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.article-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.3;
}

.article-excerpt {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.article-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article-link:hover {
    gap: 0.8rem;
}

/* =========================================
   FOOTER
   ========================================= */
.main-footer {
    background: var(--primary-color);
    color: rgba(255,255,255,0.8);
    padding: 4rem 0 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-column {
    flex: 1;
    min-width: 250px;
    margin-bottom: 2.5rem;
}

.footer-column h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}

.footer-column p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.footer-column ul a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-column ul a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-bottom {
    background: rgba(0,0,0,0.2);
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

/* =========================================
   AUTH PAGES
   ========================================= */
.auth-body {
    background-color: var(--primary-color);
    background-image: linear-gradient(rgba(26, 30, 38, 0.9), rgba(26, 30, 38, 0.9)), var(--hero-image-url);
    background-size: cover;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.auth-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 450px;
    position: relative;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    margin-top: 60px; 
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .auth-logo {
    color: var(--text-main);
}

.auth-title {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Form Styles */
.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.auth-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 198, 179, 0.15);
}

.btn-full {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0.9rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Fehlermeldungen */
.alert {
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #ef4444;
}
[data-theme="dark"] .alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background-color: #f0fdfa;
    border: 1px solid #ccfbf1;
    color: #0f766e;
}
[data-theme="dark"] .alert-success {
    background-color: rgba(15, 118, 110, 0.1);
    border-color: rgba(15, 118, 110, 0.3);
    color: #5eead4;
}

/* =========================================
   PROFILE PAGE STYLES
   ========================================= */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
}

.profile-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.profile-card h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
[data-theme="dark"] .profile-card h3 {
    color: var(--accent-color);
}

.profile-card .auth-form {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.profile-card .auth-form .form-group {
    width: 100%;
    margin-bottom: 0.5rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.hint-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-card .auth-form button[type="submit"] {
    margin-top: auto;
    width: 100%;
    border: none;
}

.input-readonly {
    background-color: var(--bg-body);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-color);
}

/* =========================================
   HILFSKLASSEN / UTILITIES
   ========================================= */

/* Versteckt ein Element visuell, aber hält es für Screenreader zugänglich */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =========================================
   BREADCRUMB NAVIGATION (Global)
   ========================================= */
   
.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent-color);
}

.breadcrumb span {
    margin: 0 0.5rem;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    .hamburger {
        display: block;
    }
    .nav-actions {
        display: none;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .footer-container {
        flex-direction: column;
    }
}