:root {
    /* Light Mode (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    --accent-primary: #1E6EE6;
    --accent-secondary: #0052a3;
    --highlight-color-green: #00E593;
    
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    --widget-bg: #ffffff;
    --widget-border: #e0e0e0;

    --border-radius: 4px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #121212;
        --bg-secondary: #191E26;
        --bg-tertiary: #292E35;
        
        --text-primary: #ffffff;
        --text-secondary: #b3b3b3;
        --text-tertiary: #878C93;
        
    --accent-primary: #1E6EE6;
    --accent-secondary: #5ba3ff;
    --highlight-color-green: #00E593;
        
        --border-color: #292E35;
        --shadow-color: rgba(0, 0, 0, 0.3);
        
        --widget-bg: #1e1e1e;
        --widget-border: #404040;
    }
}

/* Wenn JS `data-theme` auf dem HTML-Element setzt, überschreibe die Variablen entsprechend */
:root[data-theme="dark"], html[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #191E26;
    --bg-tertiary: #292E35;
    
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #808080;
    
    --accent-primary: #1E6EE6;
    --accent-secondary: #5ba3ff;
    --highlight-color-green: #00E593;
    
    --border-color: #292E35;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --widget-bg: #191E26;
    --widget-border: #404040;
}

:root[data-theme="light"], html[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    --accent-primary: #1E6EE6;
    --accent-secondary: #0052a3;
    --highlight-color-green: #00E593;
    
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    --widget-bg: #ffffff;
    --widget-border: #e0e0e0;
}

/* Reset und Basis-Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML und Body Grundeinstellungen */
html {
    font-size: 10px; /* root font-size fixed to 10px */
    scroll-behavior: smooth;
}

/* Sanfte Transitionen für Farbänderungen */
:root {
    transition: 
        color 0.42s ease-out,
        background-color 0.42s ease-in-out,
        border-color 0.42s ease-in-out,
        box-shadow 0.42s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px;
    cursor: pointer;
    transition: 
        background-color 0.2s ease-out,
        border-color 0.2s ease-out;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
}

.theme-toggle-light {
    display: none;
}

.theme-toggle-dark {
    display: inline-block;
}

[data-theme="dark"] .theme-toggle-light {
    display: inline-block;
}

[data-theme="dark"] .theme-toggle-dark {
    display: none;
}

.widget {
    background-color: var(--widget-bg);
    border: 1px solid var(--widget-border);
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 100%;
    max-width: 550px;
    height: 730px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--border-radius);
    overflow-y: auto;
}

.widget-head,
.widget-content,
.widget-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.widget-head {
    min-height: 64px;
    position: sticky;
    background-color: var(--bg-secondary);
    top: 0;
    padding: 16px;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
    z-index: 2;
}

.widget-content {
    padding: 24px 16px;
    height: 100%;
    border-bottom: 1px solid var(--border-color);
}

.widget-bottom {
    position: sticky;
    background-color: var(--bg-secondary);
    bottom: 0;
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 16px;
    align-items: flex-end;
    border-top: 1px solid var(--border-color);
}

.material-icons {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* Typografie */

.widget-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
    gap: 8px;
}

/* widget-info: show more/less */
.widget-info {
    width: 100%;
}

.info-text {
    position: relative;
    overflow: hidden;
    transition: max-height 0.28s ease;
}
.info-text.collapsed {
    max-height: 45px; /* ~ 4 lines */
}
.info-text::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--widget-bg) 100%);
    pointer-events: none;
}

.info-toggle {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
}

.callout {
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.callout h4 {
    font-size: 16px;
}

.callout-text {
    display: flex;
    flex-direction: column;
}

/* Make gradient match dark mode when applicable */
html[data-theme="dark"] .info-text::after {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--widget-bg) 100%);
}

/* Typografie */
.text-highlight {
    color: var(--highlight-color-green);
    font-weight: 600;
}

h2 {
    font-size: 16px;
    font-weight: 400;
}

h3 {
    font-size: 16px;
    margin-bottom:8px;
    line-height: 1.2;
}

p {
    margin-bottom: 16px;
}

/* Links */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* Listen */
ul, ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

/* Bilder */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
}

.widget-commentary {
    display: flex;
    align-items: center;
        gap: 8px; /* unchanged */
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
}

.primary-button {
    background-color: var(--accent-primary);
    color: #fff;
        padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s ease-out;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-button:hover {
    background-color: var(--accent-secondary);
}

.secondary-button {
    background-color: var(--bg-secondary);
    color: var(--accent-primary);
        padding: 8px 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid var(--accent-primary);
    transition: 
        background-color 0.2s ease-out,
        border-color 0.2s ease-out;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


/* Author */
.widget-author {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
        margin-bottom: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    padding: 0px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.author-pfp {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-weight: 500;
}

.author-fullname {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.author-date {
    color: var(--text-tertiary);
    font-size: 16px;
    margin: 0;
}

/* Weitere Utility-Klassen */
.widget-date {
    color: var(--text-tertiary);
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 9px; /* was 56.25% */
    }
}

@media (max-width: 576px) {
    html {
        font-size: 8px; /* was 50% */
    }
}