/* Front-end styles for Flat Headless CMS */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
}

/* Language switcher */
.language-switcher-flags {
    display: flex;
    gap: 0.5rem;
}

.language-flag {
    display: inline-block;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.language-flag:hover, 
.language-flag.active {
    opacity: 1;
}

.language-switcher-links {
    display: flex;
    gap: 1rem;
}

.language-link {
    color: #495057;
}

/* Dropdown hover behavior with fade in up animation */
.dropdown-menu {
    display: block;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle:hover {
    text-decoration: none;
    text-decoration: none;
}

.language-link:hover,
.language-link.active {
    color: #007bff;
    text-decoration: underline;
}

/* Hero section */
.hero-section {
    padding: 5rem 0;
    background-color: #f8f9fa;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    color: #6c757d;
}

/* Single post */
article header {
    margin-bottom: 2rem;
}

article h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

article .post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

article .post-content h2,
article .post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

article .post-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

article blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    font-style: italic;
    color: #6c757d;
}

/* Footer */
footer {
    border-top: 1px solid #e9ecef;
    padding: 3rem 0;
    margin-top: 3rem;
}

/* Utility classes */
.text-primary {
    color: #007bff !important;
}

/* Theme toggle */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

#theme-toggle #theme-icon {
    transition: transform 0.3s ease;
}

#theme-toggle:active #theme-icon {
    transform: scale(0.9);
}

/* Dark mode styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #1e1e1e !important;
    color: #e0e0e0;
}

body.dark-mode .navbar-brand {
    color: #e0e0e0 !important;
}

body.dark-mode .navbar-nav .nav-link {
    color: rgba(224, 224, 224, 0.8) !important;
}

body.dark-mode .navbar-nav .nav-link:hover {
    color: #e0e0e0 !important;
}

body.dark-mode .btn-outline-secondary {
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .btn-outline-secondary:hover {
    background-color: #333;
    border-color: #777;
    color: #e0e0e0;
}

body.dark-mode .hero-section {
    background-color: #1a1a1a;
}

body.dark-mode .hero-section p {
    color: #ccc;
}

body.dark-mode .dropdown-menu {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #3a3a3a;
    color: #fff;
}


/* Custom theme variables */
:root {
    --theme-bg: #ffffff;
    --theme-text: #212529;
    --theme-nav-bg: #f8f9fa;
    --theme-nav-text: #495057;
    --theme-card-bg: #ffffff;
    --theme-card-border: rgba(0, 0, 0, 0.125);
    --theme-btn-secondary: #6c757d;
    --theme-btn-secondary-hover: #5c636a;
    --theme-btn-outline-border: rgba(0, 0, 0, 0.25);
    --theme-btn-outline-hover: #e9ecef;
    --theme-dropdown-bg: #ffffff;
    --theme-dropdown-border: rgba(0, 0, 0, 0.15);
    --theme-dropdown-item-hover: #e9ecef;
    --theme-hero-bg: #f8f9fa;
    --theme-hero-text: #6c757d;
}

[data-bs-theme="dark"] {
    --theme-bg: #121212;
    --theme-text: #e0e0e0;
    --theme-nav-bg: #1e1e1e;
    --theme-nav-text: rgba(224, 224, 224, 0.8);
    --theme-card-bg: #1e1e1e;
    --theme-card-border: #333;
    --theme-btn-secondary: #555;
    --theme-btn-secondary-hover: #666;
    --theme-btn-outline-border: #555;
    --theme-btn-outline-hover: #333;
    --theme-dropdown-bg: #2a2a2a;
    --theme-dropdown-border: #444;
    --theme-dropdown-item-hover: #3a3a3a;
    --theme-hero-bg: #1a1a1a;
    --theme-hero-text: #ccc;
}

/* Apply theme variables */
body {
    background-color: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}

.navbar {
    background-color: var(--theme-nav-bg) !important;
}

.navbar-brand {
    color: var(--theme-text) !important;
}

.navbar-nav .nav-link {
    color: var(--theme-nav-text) !important;
}

.navbar-nav .nav-link:hover {
    color: var(--theme-text) !important;
}

.btn-outline-secondary {
    border-color: var(--theme-btn-outline-border) !important;
    color: var(--theme-text) !important;
}

.btn-outline-secondary:hover {
    background-color: var(--theme-btn-outline-hover) !important;
    border-color: var(--theme-btn-secondary) !important;
    color: var(--theme-text) !important;
}

.dropdown-menu {
    background-color: var(--theme-dropdown-bg) !important;
    border-color: var(--theme-dropdown-border) !important;
}

.dropdown-item {
    color: var(--theme-text) !important;
}

.dropdown-item:hover {
    background-color: var(--theme-dropdown-item-hover) !important;
    color: var(--theme-text) !important;
}

.hero-section {
    background-color: var(--theme-hero-bg) !important;
}

.hero-section p {
    color: var(--theme-hero-text) !important;
}

.card {
    background-color: var(--theme-card-bg) !important;
    border-color: var(--theme-card-border) !important;
}

.card .card-body {
    color: var(--theme-text) !important;
}

footer {
    background-color: var(--theme-nav-bg) !important;
    border-top-color: var(--theme-card-border) !important;
    color: var(--theme-text) !important;
}

footer .text-muted {
    color: var(--theme-nav-text) !important;
}

footer a {
    color: var(--theme-text) !important;
}

footer a:hover {
    color: var(--theme-btn-secondary-hover) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    article h1 {
        font-size: 1.8rem;
    }

    article .post-content {
        font-size: 1rem;
    }
}

