@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap');

/* 0. css variables for theming */
:root {
    /* main theme colors - light mode default */
    --primary-accent: #e63946;
    --secondary-accent: #fde2e4;
    
    /* background colors */
    --bg-main: #ffffff;
    --bg-section-secondary: #f5f5f5; /* bulma white-ter */
    --bg-section-tertiary: #dbdbdb;  /* bulma grey-lighter */
    --bg-card: #ffffff;
    --bg-header: transparent;
    --bg-code: #f5f5f5;
    
    /* text colors */
    --text-title: #363636;
    --text-body: #4a4a4a;
    --text-muted: #7a7a7a;
    --text-nav: #333333;
    
    /* ui elements */
    --border-subtle: #f0f0f0;
    --shadow-soft: rgba(0, 0, 0, 0.03);
    --shadow-hover: rgba(0, 0, 0, 0.08);
    --shadow-card: rgba(10, 10, 10, 0.1);
    
    /* hero adjustment */
    --hero-overlay-opacity: 0.95; /* high opacity for misty white look */
    --hero-overlay-color: #ffffff; /* white overlay for light mode */
    --hero-text-color: #363636;

    /* tags */
    --tag-red: #d9534f;
  --tag-blue: #337ab7;
  --tag-green: #5cb85c;
  --tag-black: #333333;
  --tag-yellow: #aebf28; /* olive-yellow to match 'android' screenshot */
  --tag-purple: #8e44ad;
  --tag-orange: #f0ad4e;
  --tag-text: #ffffff;
}

/* dark mode overrides - oled friendly */
[data-theme="dark"] {
    /* adjusted accents for dark mode */
    --primary-accent: #ff6b6b;
    --secondary-accent: #2d1b1e; 
    
    /* black backgrounds */
    --bg-main: #000000;
    --bg-section-secondary: #000000;
    --bg-section-tertiary: #0a0a0a;
    --bg-card: #000000;
    --bg-header: #000000;
    --bg-code: #252525;
    
    /* light text */
    --text-title: #ffffff;
    --text-body: #d1d1d1;
    --text-muted: #9e9e9e;
    --text-nav: #ffffff;
    
    /* dark ui elements */
    --border-subtle: #333333;
    --shadow-soft: rgba(0, 0, 0, 0); /* no shadow on black */
    --shadow-hover: rgba(255, 255, 255, 0.05); /* faint glow */
    --shadow-card: rgba(255, 255, 255, 0.1);
    
    /* darken hero image */
    --hero-overlay-opacity: 0.7;
    --hero-overlay-color: #000000; /* black overlay for dark mode */
    --hero-text-color: #ffffff;

    /* tags */
    --tag-red: #c9302c;
    --tag-blue: #286090;
    --tag-green: #449d44;
    --tag-black: #1a1a1a;
    --tag-yellow: #8e9e20;
    --tag-purple: #703688;
    --tag-orange: #ec971f;
}

/* global transitions */
body, section, .box, .navbar, .feature-box, .showcase-content, .store-badge, .menu-list a, .content h1, .content h2, .content h3, .footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

strong {
    color: var(--text-title);
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    font-family: "Quicksand", sans-serif;
}

/* Helper for pages that need padding under fixed navbar (Wiki) */
body.with-navbar-padding {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wiki-container, body.with-navbar-padding > .section {
    padding-top: 2rem;
    margin-top: 3.5rem; /* space for fixed navbar */
    flex: 1; /* This pushes the footer to the bottom */

}

.navbar-end {
    margin-right: 1em;
}

/* 1. background image setup */
.hero-background {
    background: var(--hero-bg-image) no-repeat center center;
    background-size: cover;
    position: relative;
    transition: background-image 0.3s ease;
}

/* dynamic overlay for hero image */
.hero-background::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: var(--hero-overlay-color);
    opacity: var(--hero-overlay-opacity);
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
}

/* ensure content stays on top of overlay */
.hero-body, .hero-foot {
    position: relative;
    z-index: 1;
}

/* 2. hero specific styles */
.hero-title {
    color: var(--hero-text-color) !important;
}

/* hero notice (optional) */
/* hero notice (optional, floating so center stays centered) */
.hero-content {
    position: relative;
}

.hero-notice--float {
    position: absolute;
    top: auto;
    bottom: calc(100% + 4em);
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 90vw);
    z-index: 2;
}

.hero-notice--float .notification {
    background: var(--bg-card);
    color: var(--text-body);
    border: 1px solid silver;
    padding: 0.85rem 1.25rem;
    font-weight: 700;
}

.hero-notice--float .notification a {
    color: var(--primary-accent);
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    .hero-notice--float {
        bottom: calc(100% + 2em);
    }
}

.hero-subtitle {
    padding: 1em;
    max-width: 1100px; 
    margin-left: auto; 
    margin-right: auto;
    color: var(--hero-text-color) !important;
    opacity: 0.9;
}

.hero-button {
    border: 1px solid var(--shadow-card) !important;
    border-radius: 0.5em !important;
    box-shadow: 0 6px 6px var(--shadow-card);
}

/* store badges styling */
.store-badge {
    border: 2px solid var(--text-title);
    border-radius: 12px;
    color: var(--text-title);
    background-color: transparent;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    margin: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 200px; /* ensure consistent width */
}

.store-badge:hover {
    background-color: var(--text-title);
    color: var(--bg-main); /* contrast color on hover */
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-hover);
}

.store-badge .icon {
    margin-right: 1rem;
}

.store-badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    text-align: left;
}

.store-badge-small {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
}

.store-badge-large {
    font-size: 1.25rem;
    font-weight: 700;
}

/* navbar styling */
.navbar {
    background-color: var(--bg-main);
}

.navbar-item, .navbar-link {
    color: var(--text-nav);
}

/* dropdown styling (language menu) */
.navbar-dropdown {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 24px var(--shadow-card);
}

.navbar-dropdown .navbar-item {
    color: var(--text-body);
}

.navbar-dropdown .navbar-item:hover {
    background-color: var(--bg-section-secondary);
    color: var(--primary-accent);
}

/* ensure hover colors take precedence */
.navbar-item:hover, .navbar-link:hover, .navbar-item.is-active {
    background-color: transparent !important;
    color: var(--primary-accent) !important;
}

/* keep dropdown trigger stable when menu is open */
.navbar-item.has-dropdown.is-hoverable:hover .navbar-link,
.navbar-item.has-dropdown.is-active .navbar-link {
    background-color: transparent !important;
    color: var(--primary-accent) !important;
}

/* Navbar Icon Alignment Fix */
.navbar-link .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo overrides */
.navbar-brand .navbar-item img {
    max-height: 2.5rem; /* Make logo bigger */
}

/* Logo theming logic */
.logo-dark { display: none; }

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

[data-theme="dark"] .navbar-dropdown {
    background-color: #0a0a0a;
    border-color: #222222;
}

[data-theme="dark"] .navbar-dropdown .navbar-item {
    color: var(--text-body);
}

[data-theme="dark"] .navbar-dropdown .navbar-item:hover {
    background-color: #111111;
    color: var(--primary-accent);
}

@media screen and (min-width: 1024px) {
.hero-title {
    font-size: 4em !important;
}

.hero-subtitle {
    font-size: 2em !important;
}
}

/* mobile specific layout */
@media screen and (max-width: 1023px) {
    .navbar {
        background-color: var(--bg-header); /* solid bg on mobile */
    }

    /* move burger to the left */
    .navbar-brand {
        flex-direction: row-reverse;
        justify-content: flex-end; /* align items to the left */
        width: 100%;
    }
    
    .navbar-burger {
        margin-left: 0;
        margin-right: 0;
        color: var(--text-nav);
    }

    .navbar-menu {
        background-color: var(--bg-card);
        backdrop-filter: blur(10px);
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 16px var(--shadow-card);
    }
    
    .navbar-item {
        color: var(--text-body);
    }

    .wiki-sidebar {
        position: relative;
        top: 0;
        height: auto;
        margin-bottom: 3rem;
        padding-right: 0;
        border-bottom: 1px solid var(--border-subtle);
        padding-bottom: 2rem;
    }
}

/* 3. brand colors - minimalist overrides */
.has-bg-pink-light {
    background-color: var(--secondary-accent);
    color: var(--primary-accent);
}

/* text color utility replacements */
.title { color: var(--text-title); }
.subtitle { color: var(--text-muted); }
.content { color: var(--text-body); }
.has-text-grey { color: var(--text-muted) !important; }
.has-text-grey-darker { color: var(--text-title) !important; }

/* section backgrounds */
.section-secondary { background-color: var(--bg-section-secondary); }
.section-tertiary { background-color: var(--bg-section-tertiary); }
.section-main { background-color: var(--bg-main); }

/* 4. feature styles */
.feature-box {
    padding: 3rem; /* generous spacing */
    height: 100%;
    border: 1px solid var(--border-subtle); /* subtle border */
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-soft); /* soft initial shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background-color: var(--bg-card);
}

.feature-box:hover {
    transform: translateY(-5px); /* lift effect */
    box-shadow: 0 15px 30px var(--shadow-hover); /* deeper shadow on hover */
    
}

/* increased specificity to override bulma .icon.is-large */
.icon.feature-icon {
    border-radius: 8px;
    border-color: var(--primary-accent); /* distinct hover in dark mode */
    border-style: solid;
    border-width: 1px;
    width: 4rem; /* increased padding area */
    height: 4rem; /* increased padding area */
    display: flex; 
    align-items: center; 
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* 5. showcase styles */
.showcase-content {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 0.5em 1em -0.125em var(--shadow-card), 0 0px 0 1px rgba(10, 10, 10, 0.02);
    background-color: var(--bg-section-secondary);
}

.showcase-container {
    max-width: 900px;
}

.showcase-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.showcase-img.is-active {
    opacity: 1;
}

.showcase-img .showcase-media,
.showcase-img .showcase-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* override bulma tabs color */
.tabs ul {
    border-bottom-color: var(--border-subtle); /* dynamic border for dark mode */
}

.tabs a {
    color: var(--text-muted);
    border-bottom-color: var(--border-subtle);
    transition: all 0.3s ease;
}

.tabs a:hover {
    color: var(--text-title);
    border-bottom-color: var(--text-title);
}

.tabs li.is-active a {
    border-bottom-color: var(--primary-accent);
    color: var(--primary-accent);
}

/* Dark mode overrides for boxed tabs to remove white backgrounds */
[data-theme="dark"] .tabs.is-boxed a {
    color: var(--text-muted);
    border: 1px solid transparent;
    border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .tabs.is-boxed a:hover {
    background-color: var(--bg-section-tertiary);
    border-bottom-color: var(--border-subtle);
    color: var(--text-title);
}

[data-theme="dark"] .tabs.is-boxed li.is-active a {
    background-color: var(--bg-main);
    border-color: var(--border-subtle);
    border-bottom-color: transparent !important;
    color: var(--primary-accent);
}

/* mobile aspect ratio tweak */
@media screen and (max-width: 768px) {
    .showcase-content {
        aspect-ratio: 1/1;
    }
}

/* 6. testimonial styles */
.testimonial-box {
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
}

.testimonial-avatar {
    border: 3px solid var(--secondary-accent); 
    padding: 2px;
}

/* 7. support styles */
.support-container {
    max-width: 800px;
}

.heart-icon {
    color: var(--primary-accent);
}

/* theme toggle button */
#theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-nav);
    cursor: pointer;
}

#theme-toggle:hover {
    color: var(--primary-accent);
}


.align-baseline {
    align-items: baseline;
}

/* --- WIKI SPECIFIC STYLES --- */

.wiki-container {
    padding-bottom: 4rem;
}

/* sidebar styling */
.wiki-sidebar {
    position: sticky;
    top: 5rem; /* navbar height + padding */
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 1.5rem;
}

.search-container {
    margin-bottom: 2rem;
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    background-color: var(--bg-main);
    border: 1px solid var(--border-subtle);
    color: var(--text-body);
    border-radius: 6px;
    padding: 0.5em 1em 0.5em 2.5em;
    width: 100%;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-accent);
}

.search-icon {
    position: absolute;
    left: 0.75em;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9em;
    pointer-events: none;
}

.search-results {
    margin-top: 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background-color: var(--bg-main);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-results-item a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--text-body);
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
}

.search-results-item:last-child a {
    border-bottom: 0;
}

.search-results-item a:hover {
    background-color: var(--bg-section-secondary);
    color: var(--primary-accent);
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.search-result-snippet {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-result-empty {
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
}

.theme-image--dark {
    display: none !important;
}

[data-theme="dark"] .theme-image--dark {
    display: block !important;
}

[data-theme="dark"] .theme-image--light {
    display: none !important;
}

/* menu styling */
.menu-label {
    color: var(--text-muted);
    font-size: 0.85em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75em;
}

.menu-list a {
    color: var(--text-body);
    border-radius: 6px;
    padding: 0.5em 0.75em;
    font-size: 0.95em;
}

.menu-list a:hover {
    background-color: var(--bg-section-secondary);
    color: var(--primary-accent);
}

.menu-list a.is-active {
    background-color: var(--secondary-accent);
    color: var(--primary-accent);
    font-weight: 600;
}

/* content styling overrides */
.content h1, .content h2, .content h3, .content h4 {
    color: var(--text-title);
    font-weight: 700;
}

.content h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.content h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.5rem; }
.content h3 { font-size: 1.4rem; margin-top: 2rem; }

.content code {
    background-color: var(--bg-code);
    color: var(--primary-accent);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.content pre {
    background-color: var(--bg-code) !important;
    border: none;
    color: var(--text-body);
    border-radius: 8px;
    padding: 1.25rem;
}

.content pre code {
    background-color: transparent !important;
    padding: 0;
    border-radius: 0;
}

.content blockquote {
    background-color: var(--bg-section-secondary);
    border-left: 4px solid var(--primary-accent);
    padding: 1em 1.5em;
    color: var(--text-body);
}

.chat-bubble {
    max-width: 80%;
    width: fit-content;
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    background-color: var(--bg-section-secondary);
    color: var(--text-body);
    box-shadow: 0 6px 12px var(--shadow-soft);
    line-height: 1.5;
}

.chat-bubble--left {
    margin-right: auto;
    border-top-left-radius: 6px;
}

.chat-bubble--right {
    margin-left: auto;
    border-top-right-radius: 6px;
    background-color: var(--secondary-accent);
    color: var(--text-title);
}

.content a,
.content a:visited {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.content a:hover,
.content a:focus {
    color: var(--text-title);
    text-decoration: underline;
}

.breadcrumb-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.breadcrumb-text a {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-text a:hover {
    color: var(--text-title);
    text-decoration: underline;
}

/* footer styling */
.footer {
    background-color: var(--bg-section-secondary);
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

/* tag styling */
/* base class for the tag */
.tag-style {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle; /* critical for aligning with text line */
  
  /* bulma-like metrics */
  font-size: 0.90rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 0.25em 0.6em;
  border-radius: 4px;
  
  color: var(--tag-text) !important; /* force white text */
  white-space: nowrap;
  
  /* ensure icon spacing */
  gap: 0.4em;
  
  /* reset bulma button styles if 'btn' class is used */
  border: none;
  cursor: default;
  height: auto;
  text-decoration: none;
  transition: opacity 0.2s;
}

/* icon specific tweaks */
.tag-style i {
  font-size: 0.9em; /* icon slightly smaller than text usually looks better */
}

/* color variants */
.tag-style.red { background-color: var(--tag-red); }
.tag-style.blue { background-color: var(--tag-blue); }
.tag-style.green { background-color: var(--tag-green); }
.tag-style.black { background-color: var(--tag-black); }
.tag-style.yellow { background-color: var(--tag-yellow); }
.tag-style.purple { background-color: var(--tag-purple); }
.tag-style.orange { background-color: var(--tag-orange); }

/* hover effect (optional, subtle opacity change) */
.tag-style:hover {
  opacity: 0.9;
  color: var(--tag-text);
}

/* container to align the image with text */
.callout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: text-bottom;
  margin: 0 0.1em;
  line-height: 1;
}

.callout img {
  height: 1.1em; 
  width: auto;
  transform: translateY(-0.05em); 
  display: block; /* removes potential inline spacing issues */
}

dt {
    font-weight: 700;
}

th {
    font-weight: 700;
    color: var(--text-body) !important;
}
