/* Define CSS custom properties (variables) */
:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --text-on-primary: white;
    --secondary-color: #2c5aa0;
    --secondary-dark: #1e3d6f;
}

/* Base styles from old Vue app */
*, *::before, *::after {
    background-repeat: no-repeat;
    box-sizing: inherit;
}

html {
    box-sizing: border-box;
    overflow-y: scroll;
    -webkit-text-size-adjust: 100%;
    word-break: normal;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    font-size: 16px;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    font-family: "Source Sans Pro", sans-serif;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #fff;
    color: rgba(0, 0, 0, 0.87);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    max-width: 100%;
    position: relative;
    align-items: center;
}

/* Header styles matching old app */
.navbar.is-fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 64px;
    max-width: 1250px;
    margin: 0 auto;
    margin-top: 0px;
    transform: translateY(0px);
    background-color: #fff;
    border-color: #fff;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 
                0 4px 5px 0 rgba(0, 0, 0, 0.14), 
                0 1px 10px 0 rgba(0, 0, 0, 0.12);
    border-radius: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                left 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                right 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), 
                max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container for header */
.navbar > .container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Navbar brand should be at the start */
.navbar-brand {
    display: flex;
    align-items: center;
    height: 64px;
}

/* Navbar menu on desktop */
.navbar-menu {
    display: flex;
    flex-grow: 1;
    justify-content: flex-end;
}

/* Ensure navbar-end aligns to the right */
.navbar-menu .navbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navbar brand and items */
.navbar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Hamburger button - hidden on desktop by default */
.navbar-burger {
    display: none;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    position: relative;
    margin-left: auto;
}

/* Show hamburger on mobile */
@media (max-width: 768px) {
    .navbar-burger {
        display: block !important;
    }
}

.navbar-burger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 24px;
    background: #333;
    border-radius: 1px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease-in-out;
}

.navbar-burger span:nth-child(1) {
    top: 35%;
}

.navbar-burger span:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.navbar-burger span:nth-child(3) {
    bottom: 35%;
}

.navbar-item {
    text-decoration: none;
    color: rgba(0, 0, 0, 0.87);
    padding: 8px 12px;
    margin: 0;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: 400;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    height: 64px;
}

.navbar-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.navbar-item.active {
    background-color: rgba(0, 0, 0, 0.08);
}

/* Navbar item images */
.navbar-item img {
    max-height: 50px;
    width: auto;
}

.navbar-item .icon img {
    width: 25px;
    height: 25px;
}

/* Content wrapper */
.content-wrapper {
    width: 100%;
    max-width: 1250px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Main content */
.main-content {
    margin-top: 64px;
    flex: 1 0 auto;
    background-color: #f5f5f5;
    width: 100%;
}

/* Full width image */
.full-width-image {
    width: 100%;
    padding: 0;
}

.full-width-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Container for consistent max-width */
.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 2vw;
}

/* Chapter cards container */
.chapter-cards-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* Chapter container */
.chapter-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 2rem 0;
    width: 100%;
}

/* Typography */
.title {
    font-family: "Source Sans Pro", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Source Sans Pro", sans-serif;
}

h2 {
    margin: 8px 0px 0px 0px;
    font-size: 1.5rem;
}

h3 {
    margin: 6px 0px 0px 0px;
    font-size: 1.4rem;
}

h4 {
    margin: 5px 0px 0px 0px;
    font-size: 1.3rem;
}

h5 {
    margin: 4px 0px 0px 0px;
    font-size: 1.1rem;
}

/* Chapter styling (for content sections) */
.chapter {
    max-width: 1250px;
    background-color: transparent;
    margin: 60px auto;
    font-family: "Open Sans";
    font-size: 1rem;
    font-weight: 500;
}

.chapter p {
    margin: 20px auto 10px;
}

.chapter p b {
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--secondary-dark);
    color: var(--text-on-primary);
    padding: 0;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    flex-shrink: 0;
    width: 100%;
}

.footer-links {
    width: 100%;
    padding: 8px 0;
}

.footer-links-content {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.footer-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 4px;
    font-family: "Open Sans", sans-serif;
    font-size: 0.875rem;
}

.footer-copyright {
    background: rgba(0,0,0,0.2);
    width: 100%;
    padding: 8px 0;
}

.footer-copyright-content {
    max-width: 1250px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.875rem;
    font-family: "Open Sans", sans-serif;
    padding: 0 16px;
}

/* Besistem Primary Button */
.button.besistem-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.button.besistem-primary:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: white;
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #333;
    color: white;
    padding: 1rem 0;
    z-index: 1001;
}

.cookie-consent .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 16px;
}

.cookie-consent p {
    margin: 0;
    flex: 1;
    font-family: "Open Sans", sans-serif;
}

.cookie-consent .button {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Open Sans", sans-serif;
    font-weight: 500;
}

.cookie-consent .button:hover {
    background-color: var(--primary-dark);
}

/* Card styles */
.card_h {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 1.5em;
    word-break: keep-all;
}

.card_a_h {
    font-weight: 500;
    font-size: 1em;
    word-break: keep-all;
    font-weight: 600;
}

/* Image styles */
.chapter img {
    width: 750px;
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.chapter img:hover {
    cursor: zoom-in;
}

/* Content styling for chapters */
.chapter .content {
    font-size: 1.1rem;
    line-height: 1.6;
}

.chapter .content p {
    margin-bottom: 1rem;
}

.chapter .content ul {
    margin-bottom: 1rem;
}

.chapter .content li {
    margin-bottom: 0.5rem;
}

/* Style for images with background */
.chapter .fsclass {
    background-color: #E5E5E5;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.chapter .fsclass img {
    max-width: 100%;
    height: auto;
}

/* Progress bar */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(244, 67, 54, 0.3);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #f44336;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cookie-consent .container {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-consent .button {
        margin-top: 0.5rem;
    }
    
    .container {
        padding: 0 4vw;
    }
    
    /* Navbar menu - hidden by default on mobile */
    .navbar-menu {
        display: none !important;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        padding: 1rem 0;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
    
    /* When navbar menu is active (toggled via hamburger) */
    .navbar-menu.is-active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    /* Ensure the hamburger button is visible on mobile */
    .navbar-burger {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Navbar items in mobile menu */
    .navbar-menu .navbar-end {
        flex-direction: column;
        align-items: stretch;
    }
    
    .navbar-menu .navbar-item {
        height: auto;
        padding: 1rem 1.5rem;
        margin: 0;
        border-radius: 0;
        justify-content: flex-start;
    }
    
    .navbar-menu .navbar-item:hover {
        background-color: rgba(0, 0, 0, 0.04);
    }
    
    .navbar-menu .navbar-item .icon {
        margin-right: 1rem;
    }
    
    .navbar-menu .navbar-item span:not(.icon) {
        display: inline;
    }
    
    /* Hamburger button styling */
    .navbar-burger {
        display: block !important;
        width: 3rem;
        height: 3rem;
        position: relative;
        cursor: pointer;
        margin-left: auto;
    }
    
    .navbar-burger span {
        display: block;
        position: absolute;
        height: 2px;
        width: 24px;
        background: #333;
        border-radius: 1px;
        left: 50%;
        transform: translateX(-50%);
        transition: all 0.3s ease-in-out;
    }
    
    .navbar-burger span:nth-child(1) {
        top: 35%;
    }
    
    .navbar-burger span:nth-child(2) {
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .navbar-burger span:nth-child(3) {
        bottom: 35%;
    }
    
    /* Hamburger active state */
    .navbar-burger.is-active span:nth-child(1) {
        top: 50%;
        transform: translate(-50%, -50%) rotate(45deg);
    }
    
    .navbar-burger.is-active span:nth-child(2) {
        opacity: 0;
    }
    
    .navbar-burger.is-active span:nth-child(3) {
        bottom: 50%;
        transform: translate(-50%, 50%) rotate(-45deg);
    }
    
    .navbar-brand {
        justify-content: space-between;
        width: 100%;
        margin-right: 0;
        flex-shrink: 1;
    }
    
    /* Hide text in navbar items when not in menu (for desktop view) */
    .navbar-item span:not(.icon) {
        display: none;
    }
    
    .navbar-item .icon {
        margin-right: 0;
    }
}
