/* Liquid Glass Design System */

/* Animated Gradient Background - ONLY in dark mode */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.3),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Keep toggle button at top on homepage only */
body.list:not(:has(.header)) .theme-toggle {
    top: 20px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 6px 20px 0 rgba(31, 38, 135, 0.4),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    transition: all 0.3s ease;
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

/* Liquid Glass for Profile/Main Content */
.profile {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

.profile_inner {
    background: transparent !important;
}

/* Liquid Glass Buttons */
.button {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.3),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.4) !important;
    transition: all 0.3s ease;
}

.button:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(31, 38, 135, 0.4),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.5) !important;
}

/* Liquid Glass Social Icons */
.social-icons a {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.3),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.social-icons a svg {
    width: 20px !important;
    height: 20px !important;
}

.social-icons a:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px 0 rgba(31, 38, 135, 0.4),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

/* Liquid Glass for Post/Paper Cards */
.post-entry,
.paper-entry {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.3) !important;
    border-radius: 16px !important;
}

.post-entry:hover,
.paper-entry:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.4) !important;
}

/* Liquid Glass for Navigation Header */
.header {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.2);
}

/* News Section (from homepage) */
.news-section {
    width: 100%;
    max-width: 700px;
    margin: 30px auto 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.news-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--primary);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: scroll;
    padding-right: 5px;
}

.news-list::-webkit-scrollbar {
    width: 6px;
}

.news-list::-webkit-scrollbar-track {
    background: var(--code-bg);
    border-radius: 3px;
}

.news-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.news-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

.news-item {
    display: flex;
    gap: 10px;
    line-height: 1.6;
    font-size: 0.95em;
}

.news-date {
    color: var(--secondary);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 80px;
}

.news-content {
    color: var(--content);
}

/* Text Colors - Keep original */
.profile h1,
.profile span {
    color: var(--primary) !important;
}

.news-title {
    color: var(--primary) !important;
}

.news-content,
.news-date {
    color: var(--content) !important;
}

.news-date {
    color: var(--secondary) !important;
}

.button-inner {
    color: var(--primary) !important;
}

/* ========== DARK MODE STYLES ========== */

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #1a1a2e 100%) !important;
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    background-attachment: fixed;
}

body.dark-mode .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: block;
}

body.dark-mode .profile h1,
body.dark-mode .profile span,
body.dark-mode .news-title,
body.dark-mode .news-content,
body.dark-mode .news-date,
body.dark-mode .button-inner {
    color: rgba(255, 255, 255, 0.95) !important;
}

body.dark-mode .news-date {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-mode .profile a,
body.dark-mode .news-content a {
    color: rgba(255, 255, 255, 1) !important;
}

body.dark-mode .theme-toggle svg {
    stroke: rgba(255, 255, 255, 0.95);
}

/* Dark mode - Liquid Glass background for logo area */
body.dark-mode .below-photo {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    padding: 20px !important;
}

body.dark-mode .below-photo img {
    filter: brightness(1.1);
}

/* Dark mode text for all content */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode p,
body.dark-mode span,
body.dark-mode li,
body.dark-mode b,
body.dark-mode strong,
body.dark-mode div,
body.dark-mode .post-title,
body.dark-mode .post-meta,
body.dark-mode .post-meta b,
body.dark-mode .post-meta span,
body.dark-mode .post-header,
body.dark-mode .post-header *,
body.dark-mode .entry-content,
body.dark-mode .entry-venue {
    color: rgba(255, 255, 255, 0.95) !important;
}

body.dark-mode a {
    color: rgba(255, 255, 255, 1) !important;
}

/* Extra specificity for author names in post-meta */
body.dark-mode .post-meta * {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Dark mode - fix header and nav background */
body.dark-mode .header,
body.dark-mode .nav {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

body.dark-mode .nav a,
body.dark-mode .logo a {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Dark mode - remove post single page background box */
body.dark-mode .post-single {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

/* Dark mode - fix footer background */
body.dark-mode .footer {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .footer,
body.dark-mode .footer span,
body.dark-mode .footer a {
    color: rgba(255, 255, 255, 0.85) !important;
}

body.dark-mode .footer a:hover {
    color: rgba(255, 255, 255, 1) !important;
}

/* SUPER HIGH PRIORITY - Override all theme CSS variables for dark mode */
body.dark-mode {
    --primary: rgba(255, 255, 255, 0.95) !important;
    --secondary: rgba(255, 255, 255, 0.75) !important;
    --content: rgba(255, 255, 255, 0.95) !important;
    --tertiary: rgba(255, 255, 255, 0.3) !important;
    --code-bg: rgba(255, 255, 255, 0.1) !important;
    --border: rgba(255, 255, 255, 0.2) !important;
}

/* Dark mode - fix blockquote and other elements */
body.dark-mode blockquote,
body.dark-mode .post-content blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

body.dark-mode pre,
body.dark-mode code {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Globe centering */
.globe-wrap {
    width: 100%;
    margin-bottom: 4px;
}

#globeViz {
    width: 280px;
    height: 280px;
    display: block;
    margin: 0 auto 8px;
}
