:root {
    --nav-height: 70px; /* Fixed height for all screen sizes */
    --footer-height: 50px;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 70px; /* Keep consistent height */
    }
}

@media (max-width: 575px) {
    :root {
        --nav-height: 70px; /* Keep consistent height */
    }
}

@media (max-width: 374px) {
    :root {
        --nav-height: 70px; /* Keep consistent height */
        --footer-height: 45px;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to-br, #f0fdfa, #d9f99d);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Universal responsive utilities */
*, *::before, *::after {
    box-sizing: border-box;
}

img, video, canvas, audio, iframe, embed, object {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Prevent horizontal overflow */
html {
    overflow-x: hidden;
}

.layout {
    display: flex;
    flex: 1;
    flex-direction: row;
    gap: 1rem;
    padding: 0.125rem;
    margin-top: var(--nav-height);
    margin-bottom: var(--footer-height);
    height: calc(100vh - var(--nav-height) - var(--footer-height));
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #49A078, #3e8865);
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0 1rem 0;
    height: calc(100% - 1rem);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #facc15 #3e8865;
    border-radius: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) and (orientation: landscape) {
    .slide-container-wrapper {
        padding-bottom: 200px !important;
    }
    #chatButton {
        bottom: 250px !important;
        z-index: 60 !important;
    }
    #chatWidget {
        bottom: 270px !important;
        z-index: 60 !important;
    }
    .navigation {
        bottom: -50px !important;
    }
}

@media (min-width: 769px) {
    .sidebar {
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: #facc15 #3e8865;
        border-radius: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Ensure body stays locked to prevent full-page scrolling */
    body {
        overflow: hidden;
    }
    
    html {
        overflow: hidden;
    }
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #3e8865;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #facc15;
}

/* Slide scrollbar styles */
.slide::-webkit-scrollbar {
    width: 8px;
}

.slide::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.slide::-webkit-scrollbar-thumb {
    background: #49A078;
    border-radius: 4px;
}

.slide::-webkit-scrollbar-thumb:hover {
    background: #3e8865;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.module-toggle {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    color: #fffbe6;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.module-toggle.hidden {
    display: none;
}

.module-toggle:hover {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.module-toggle:not(.collapsed) {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.module-toggle .fa-chevron-down {
    transition: transform 0.2s;
}

.module-toggle.collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

.module-slides {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}

.module-slides.open {
    display: flex;
}

.sidebar-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.sidebar-item:hover {
    background: rgba(250, 204, 21, 0.2);
}

.sidebar-link {
    color: #b45309;
    background: #fffbe6;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: background 0.3s, color 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(250,204,21,0.08);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-link.active,
.sidebar-item.active .sidebar-link {
    color: #facc15;
    font-weight: 800;
    background: rgba(250, 204, 21, 0.2);
}

.sidebar-link:hover, .sidebar-link:focus {
    color: #256d4f;
    background: #facc15;
    text-decoration: none;
    outline: none;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(250,204,21,0.3);
}

.sidebar-item .slide-number {
    font-weight: bold;
    color: inherit;
    width: 2rem;
    text-align: right;
    margin-right: 0.5rem;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    color: #e5e7eb;
}

/* Main Content */
.main-content {
    flex: 1;
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 2px solid rgba(73, 160, 120, 0.2);
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    margin-bottom: 1rem;
}

.max-w-5xl {
    width: 100%;
    max-width: 1280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.slide-number-display {
    font-size: 1rem;
    font-weight: 600;
    color: #256d4f;
    background: #fffbe6;
    padding: 0.5rem 2rem;
    border-radius: 0.25rem;
    margin: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.slide-container-wrapper {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.slide {
    width: 90%;
    max-width: 800px;
    background: linear-gradient(135deg, #ffffff, #e6fffa);
    border: 1px solid #e5e7eb;
    padding: 2rem;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slide:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: scale(1.01);
}

.slide.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.slide:not(.active) {
    opacity: 0;
    transform: translateY(20px);
}

.slide-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
    position: relative;
    z-index: 5;
    padding: 1.5rem;
    box-sizing: border-box;
}

.slide-content h2 {
    color: #256d4f;
    font-weight: 800;
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
}

.slide-content h2:hover {
    color: #facc15;
}

.slide-content p {
    color: #374151;
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    max-width: 700px;
}

.slide-content li {
    color: #374151;
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.slide-content ul, 
.slide-content ol {
    text-align: left;
    max-width: 700px;
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.slide-content .highlight-list li {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #49A078;
}

.slide-content .text-lg {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    box-sizing: border-box;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    z-index: 10;
}

.nav-btn {
    background: #49A078;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    outline: none;
    border: none;
    cursor: pointer;
}

.nav-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.nav-btn:hover {
    background: #facc15;
    color: #256d4f;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

.nav-btn[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background: #256d4f;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn[data-tip]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(5px);
    border: 5px solid transparent;
    border-top-color: #256d4f;
    z-index: 20;
}

.highlight-list {
    list-style: decimal;
    list-style-position: outside;
    padding-left: 2rem;
    width: 100%;
    max-width: 600px;
    margin: 1rem auto;
    text-align: left;
}

.highlight-list li {
    color: #222;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    font-weight: 500;
}

.highlight-list li:hover {
    background: #fffbe6;
    color: #256d4f;
    transform: scale(1.02);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ai-slide-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-action-box {
    background: #fffbe6;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.ai-action-box:hover {
    background: #facc15;
    color: #256d4f;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.good-prompt {
    color: #059669;
    font-weight: 600;
}

.bad-prompt {
    color: #dc2626;
    font-weight: 600;
}

nav {
    background: #49A078;
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px; /* Fixed height to prevent growth */
    min-height: 70px; /* Minimum height */
    max-height: 70px; /* Maximum height */
    display: flex;
    align-items: center;
}

/* Make nav links more prominent */
.nav-links {
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.025em !important;
}

/* Ensure all nav links are visible on different screen sizes */
@media (max-width: 1400px) {
    .nav-links {
        gap: 1rem !important; /* Reduce gap from 1.5rem to 1rem */
    }
}

@media (max-width: 1200px) {
    .nav-links {
        gap: 0.75rem !important; /* Further reduce gap */
        font-size: 0.9rem !important; /* Slightly smaller font */
    }
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 0.5rem !important; /* Minimal gap */
        font-size: 0.85rem !important; /* Smaller font for space */
    }
}

/* Prevent nav links from wrapping and ensure they're always visible */
.nav-links {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Ensure nav container gives priority to nav links */
@media (max-width: 1400px) {
    nav .container {
        gap: 2rem !important; /* Reduce gap between nav sections */
    }
    
    /* Make logo section maintain minimum space */
    nav .container > div:first-child {
        flex-shrink: 1 !important;
        min-width: 280px !important; /* Ensure logo + text has enough space */
        flex-basis: auto !important;
    }
    
    /* Make nav links section prioritize space */
    nav .container > div:last-child {
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }
    
    /* Ensure marquee doesn't encroach on logo */
    .slogan-container {
        flex: 1 !important;
        min-width: 0 !important;
        margin: 0 1rem !important; /* Add margins to prevent touching adjacent sections */
    }
}

.nav-link {
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px) !important;
}

nav .container {
    max-width: 1200px;
    margin: 0 auto 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

nav .container > div:first-child {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Reduce title font size on small screens to prevent horizontal scroll */
@media (max-width: 480px) {
    nav .container > div:first-child span {
        font-size: 1rem !important;
    }
}

.nav-link {
display: flex;
align-items: center;
white-space: nowrap;
padding: 0.5rem 0.75rem;
border-radius: 0.375rem;
transition: all 0.3s ease;
}

.nav-link:hover {
background: rgba(250, 204, 21, 0.2);
transform: translateY(-1px);
}

.nav-link i {
font-size: 0.875rem;
}

/* Mobile Navigation Dropdown */
.mobile-nav-dropdown {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
opacity: 0;
visibility: hidden;
transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
opacity 0.3s ease-out,
visibility 0.3s ease-out;
pointer-events: none;
}

.mobile-nav-dropdown.active {
opacity: 1;
visibility: visible;
pointer-events: all;
}

.mobile-nav-backdrop {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
transition: backdrop-filter 0.4s ease-out;
}

.mobile-nav-dropdown.active .mobile-nav-backdrop {
backdrop-filter: blur(8px);
}

.mobile-nav-content {
position: absolute;
top: var(--nav-height);
right: 0;
width: 280px;
max-width: 90vw;
background: linear-gradient(135deg, #ffffff, #f8fafc);
border-radius: 0 0 0 1rem;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
border: 1px solid rgba(73, 160, 120, 0.2);
transform: translateX(100%) scale(0.95);
transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
box-shadow 0.3s ease-out;
will-change: transform;
}

.mobile-nav-dropdown.active .mobile-nav-content {
transform: translateX(0) scale(1);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.mobile-nav-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.25rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
background: linear-gradient(135deg, #49A078, #3e8865);
color: white;
border-radius: 0;
}

.mobile-nav-title {
font-weight: 700;
font-size: 1rem;
}

.mobile-nav-close {
background: transparent;
border: none;
color: white;
cursor: pointer;
padding: 0.5rem;
border-radius: 0.375rem;
transition: all 0.3s ease;
}

.mobile-nav-close:hover {
background: rgba(255, 255, 255, 0.2);
transform: scale(1.1);
}

.mobile-nav-links {
list-style: none;
padding: 0.5rem 0;
margin: 0;
}

.mobile-nav-link {
display: flex;
align-items: center;
gap: 0.875rem;
padding: 0.875rem 1.25rem;
color: #1f2937;
text-decoration: none;
transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
background 0.3s ease-out;
font-weight: 500;
position: relative;
transform: translateX(30px);
opacity: 0;
overflow: hidden;
}

.mobile-nav-dropdown.active .mobile-nav-link {
transform: translateX(0);
opacity: 1;
}

.mobile-nav-dropdown.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav-dropdown.active .mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav-dropdown.active .mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav-dropdown.active .mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav-dropdown.active .mobile-nav-link:nth-child(5) { transition-delay: 0.3s; }

.mobile-nav-link::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(73, 160, 120, 0.1), transparent);
transition: left 0.6s ease-in-out;
}

.mobile-nav-link:hover::before {
left: 100%;
}

.mobile-nav-link:hover {
background: linear-gradient(135deg, #facc15, #f59e0b);
color: #1f2937;
transform: translateX(8px) scale(1.02);
border-radius: 0.5rem;
margin: 0 0.5rem;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-nav-link:active {
transform: translateX(4px) scale(0.98);
transition: all 0.1s ease-out;
}

.mobile-nav-link i {
font-size: 1.125rem;
width: 1.25rem;
text-align: center;
color: #49A078;
transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.mobile-nav-link:hover i {
color: #1f2937;
transform: scale(1.2) rotate(5deg);
}

.mobile-nav-link span {
flex: 1;
}

.mobile-nav-divider {
height: 1px;
background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
margin: 0.5rem 1.25rem;
}

/* Enhanced hamburger animation */
.hamburger {
display: none;
font-size: 1.25rem;
cursor: pointer;
background: transparent;
border: 2px solid rgba(255, 255, 255, 0.3);
color: white;
border-radius: 0.5rem;
padding: 0.5rem 0.75rem;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}

.hamburger::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s;
}

.hamburger:hover::before {
left: 100%;
}

.hamburger:hover {
background: rgba(250, 204, 21, 0.2);
border-color: #facc15;
color: #facc15;
transform: scale(1.05);
}

.slogan-container {
flex: 1 1 0%;
position: relative;
overflow: hidden;
min-width: 250px;
max-width: 250px;
height: 2rem;
display: flex;
align-items: center;
margin: 0 1rem;
}

.slogan-marquee-track {
display: flex;
width: max-content;
position: absolute;
left: 0;
top: 0;
height: 100%;
animation: marquee-loop 15s linear infinite;
white-space: nowrap;
}

.slogan-marquee {
white-space: nowrap;
color: #facc15;
font-weight: 500;
font-size: 0.85rem;
display: inline-block;
padding-right: 3rem;
overflow: hidden;
text-overflow: ellipsis;
opacity: 0.8;
}

@keyframes marquee-loop {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}

.hamburger {
display: none;
font-size: 1.25rem;
cursor: pointer;
background: #49A078;
border: none;
color: white;
border-radius: 0.5rem;
padding: 0.5rem 0.75rem;
}

.footer {
background: #DFF3EA;
border-top: 1px solid rgba(0, 0, 0, 0.1);
padding: 0.5rem 1rem;
text-align: center;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
height: 50px;
min-height: 50px;
width: 100%;
box-sizing: border-box;
display: flex;
align-items: center;
}

.footer .container {
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    overflow: hidden;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.footer-logo span {
    white-space: nowrap;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin: 0;
    flex-shrink: 0;
}



.footer-copyright {
    font-size: 0.95rem;
    color: #256d4f;
}

/* Floating navigation button (replaces home button on mobile) */
#floatingHomeBtn {
    bottom: 130px; /* Moved higher to avoid chatbot icon */
    right: 6px;
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease-out,
                background 0.4s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    background: linear-gradient(135deg, #49A078, #3e8865);
    z-index: 1001; /* Higher z-index to stay above other elements */
    will-change: transform, background, box-shadow;
}

#floatingHomeBtn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #facc15, #f59e0b);
    color: #1f2937;
}

#floatingHomeBtn:active {
    transform: scale(0.95) translateY(1px);
    transition: all 0.1s ease-out;
}

/* Responsive positioning for floating home button */
@media (max-width: 480px) {
    #floatingHomeBtn {
        bottom: 120px;
        right: 8px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    #floatingHomeBtn {
        bottom: 125px;
        right: 10px;
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #floatingHomeBtn {
        bottom: 135px;
        right: 12px;
        width: 58px;
        height: 58px;
        font-size: 1.4rem;
    }
}

@media (min-width: 1025px) {
    #floatingHomeBtn {
        bottom: 140px;
        right: 15px;
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

#chatWidget {
    bottom: 80px;
    right: 6px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999 !important;
    position: fixed !important;
}

#chatButton {
    z-index: 10000 !important;
    position: fixed !important;
}

#chatOverlay {
    z-index: 9998 !important;
    position: fixed !important;
}

.demo-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #f1f5f9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.demo-table th, .demo-table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quiz-option:hover {
    background: #fffbe6;
    color: #256d4f;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quiz-option.correct {
    background: #059669;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.quiz-option.wrong {
    background: #dc2626;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.quiz-feedback {
    display: none;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background: #f1f5f9;
}

@media (min-width: 769px) {
    .sidebar {
        display: block;
    }
    .layout {
        flex-direction: row;
        margin-top: var(--nav-height);
        margin-bottom: var(--footer-height);
        height: calc(100vh - var(--nav-height) - var(--footer-height));
    }
    .main-content {
        padding: 1rem;
        overflow: hidden;
    }
    .slide-container-wrapper {
        max-width: 1200px;
        height: 100%;
        overflow: hidden;
    }
    .slide {
        max-width: 800px;
        padding: 2rem;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .navigation {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        width: 120px;
        z-index: 10;
    }
    .nav-btn {
        width: 100%;
        padding: 0.75rem;
    }
    .footer {
        height: 50px;
    }
    
    /* Lock body and html from scrolling on desktop */
    body, html {
        overflow: hidden;
        height: 100vh;
    }
}

/* Desktop navigation responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-links {
        gap: 0.3rem !important;
    }
    
    .nav-link {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
    
    .nav-link i {
        font-size: 0.75rem !important;
    }
}

/* Reduce nav gap further on smaller desktop screens */
@media (min-width: 769px) and (max-width: 1000px) {
    nav {
        padding: 1rem 1rem !important;
    }
    
    .nav-links {
        gap: 0.2rem !important;
    }
    
    .nav-link {
        padding: 0.25rem 0.4rem !important;
        font-size: 0.65rem !important;
    }
}

@media (min-width: 1025px) and (max-width: 1200px) {
    .nav-links {
        gap: 0.5rem !important;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
}

@media (min-width: 1201px) {
    .nav-links {
        gap: 0.75rem !important;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    .sidebar.active {
        display: block !important;
        position: fixed;
        left: 0;
        top: var(--nav-height);
        width: 280px;
        height: calc(100vh - var(--nav-height));
        z-index: 1000;
        background: rgba(73, 160, 120, 0.95);
        backdrop-filter: blur(10px);
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        border-right: 1px solid rgba(255, 255, 255, 0.2);
    }
    .main-content, .max-w-5xl, .max-w-4xl, .slide-container-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        height: calc(100vh - 110px) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: stretch !important;
        align-items: stretch !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .slide-number-display {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: calc(100% - 2rem) !important;
        max-width: calc(100% - 2rem) !important;
        margin: 0 1rem !important;
        height: auto !important;
        min-height: 40px !important;
        padding: 0.75rem 1rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1rem !important;
        background: #fffbe6 !important;
        border-radius: 0.375rem !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        z-index: 2 !important;
        text-align: center !important;
        line-height: 1.4 !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
        border: 1px solid rgba(37, 109, 79, 0.1) !important;
    }

    .slide-number-display.hidden {
        display: none !important;
    }
    .slide {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.2rem 0.5rem 1.2rem 0.5rem !important;
        height: auto !important;
        max-height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex: 1 1 auto !important;
        background: linear-gradient(135deg, #ffffff, #e6fffa) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    .slide-content {
        padding: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: center !important;
        gap: 1.5rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        box-sizing: border-box !important;
    }
    .slide-content h2 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
        text-align: center !important;
        max-width: 100% !important;
    }
    .slide-content p {
        font-size: 1.1rem !important;
        line-height: 1.7 !important;
        margin-bottom: 1rem !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Mobile responsive fixes for content elements */
    .slide-content li {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 0.5rem !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Navigation responsive styles - fixed at bottom */
    .navigation {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        transform: none !important;
        flex-direction: row !important;
        gap: 0.25rem !important;
        width: 100% !important;
        padding: 0.5rem 0 !important;
        justify-content: center !important;
        align-items: center !important;
        background: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1) !important;
        z-index: 1000 !important;
        backdrop-filter: blur(10px) !important;
    }
    .nav-btn {
        width: 28% !important;
        min-width: 80px !important;
        max-width: 120px !important;
        padding: 0.5rem 0.3rem !important;
        font-size: 0.8rem !important;
        background: #49A078 !important;
        color: white !important;
        border: none !important;
        cursor: pointer !important;
        border-radius: 0.5rem !important;
        font-weight: 600 !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        text-align: center !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        outline: none !important;
    }
    
    .nav-btn:hover {
        background: #facc15 !important;
        color: #256d4f !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .nav-btn:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    .nav-btn:disabled {
        background: #d1d5db !important;
        cursor: not-allowed !important;
        box-shadow: none !important;
    }
    .footer {
        height: 50px !important;
        width: 100% !important;
        padding: 0.5rem !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 100 !important;
        background: #DFF3EA !important;
        border-top: 1px solid rgba(0,0,0,0.1) !important;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.05) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .footer .container {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        align-items: center !important;
        padding: 0 0.5rem !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    .footer-logo, .footer-socials, .footer-copyright {
        flex: 1 1 auto !important;
        text-align: center !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    /* Critical mobile overflow fixes */
    * {
        box-sizing: border-box !important;
    }
    
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .layout, .main-content, .slide-container-wrapper, .slide {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure all content elements respect mobile bounds */
    .slide-content > * {
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Force tables to be mobile-friendly */
    table, .demo-table {
        width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table thead, table tbody, table tr, table th, table td {
        display: block !important;
        width: 100% !important;
    }
    
    table tr {
        border: 1px solid #ccc !important;
        margin-bottom: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    table th, table td {
        border: none !important;
        padding: 0.25rem 0 !important;
        text-align: left !important;
    }
    
    /* Mobile-friendly list styles */
    ul, ol {
        padding-left: 1.25rem !important;
        margin: 0.5rem 0 !important;
        max-width: 100% !important;
    }
    
    li {
        margin-bottom: 0.25rem !important;
        line-height: 1.5 !important;
        word-wrap: break-word !important;
    }
    
    .highlight-list {
        padding-left: 1.25rem !important;
        margin: 0.75rem 0 !important;
        max-width: 100% !important;
    }
    
    .highlight-list li {
        font-size: 0.95rem !important;
        padding-left: 0.25rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.5 !important;
    }
    
    .demo-table {
        font-size: 0.8rem !important;
        margin: 0.75rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        white-space: nowrap !important;
    }
    
    .demo-table th, .demo-table td {
        padding: 0.4rem 0.25rem !important;
        font-size: 0.75rem !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    .quiz-container {
        gap: 0.5rem !important;
        max-width: 100% !important;
    }
    
    .quiz-option {
        padding: 0.5rem !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        word-wrap: break-word !important;
    }
    
    #chatButton {
        bottom: 60px !important;
    }
    #chatWidget {
        bottom: 80px !important;
        max-width: calc(100vw - 20px) !important;
        right: 10px !important;
    }
    .hamburger {
        display: block !important;
    }
    .nav-links {
        display: none !important;
    }
    
    /* Show mobile nav dropdown only on mobile */
    .mobile-nav-dropdown {
        display: block;
    }
}

/* Medium screen tablet styles for responsive slide display */
@media (min-width: 769px) and (max-width: 1023px) {
    .slide {
        width: 95vw;
        max-width: calc(100vw - 2rem);
        padding: 0.25rem;
        height: auto;
        max-height: 100%;
        justify-content: flex-start;
        flex: 1 1 auto;
        box-sizing: border-box;
    }
    .slide-content {
        padding: 1.25rem;
        gap: 1.75rem;
    }
    .slide-content h2 {
        font-size: 2rem;
        margin-bottom: 1.25rem;
        line-height: 1.2;
    }
    .slide-content p {
        font-size: 1.125rem;
        line-height: 1.7;
        margin-bottom: 1.25rem;
    }
    .navigation {
        position: relative !important;
        bottom: auto !important;
        top: auto !important;
        transform: none !important;
        left: 0 !important;
        right: 0 !important;
        gap: 0.75rem !important;
        justify-content: center !important;
        z-index: 2 !important;
        flex-direction: row !important;
        width: 100% !important;
        padding: 0.5rem 0 !important;
        margin-top: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .slide-number-display {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        margin: 0 0.5rem !important;
        width: calc(100% - 1rem) !important;
        max-width: calc(100% - 1rem) !important;
    }

    .slide-number-display.hidden {
        display: none !important;
    }
    .slide {
        width: 95vw;
        max-width: calc(100vw - 1rem);
        padding: 0.25rem;
        height: auto;
        max-height: 100%;
        justify-content: flex-start;
        flex: 1 1 auto;
        box-sizing: border-box;
    }
    .slide-content {
        padding: 0.25rem;
        gap: 0.75rem;
    }
    .slide-content h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    .slide-content p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    .navigation {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        transform: none !important;
        flex-direction: row !important;
        gap: 0.25rem !important;
        width: 100% !important;
        padding: 0.5rem 0 !important;
        justify-content: center !important;
        align-items: center !important;
        background: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1) !important;
        z-index: 1000 !important;
        backdrop-filter: blur(10px) !important;
    }
    .nav-btn {
        width: 28% !important;
        min-width: 80px !important;
        max-width: 120px !important;
        padding: 0.5rem 0.3rem !important;
        font-size: 0.8rem !important;
        background: #49A078 !important;
        color: white !important;
        border: none !important;
        cursor: pointer !important;
        border-radius: 0.5rem !important;
        font-weight: 600 !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        text-align: center !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        outline: none !important;
    }
    
    .nav-btn:hover {
        background: #facc15 !important;
        color: #256d4f !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .nav-btn:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    .nav-btn:disabled {
        background: #d1d5db !important;
        cursor: not-allowed !important;
        box-shadow: none !important;
    }
    .footer {
        padding: 0.3rem;
        font-size: 0.7rem;
    }
    .footer .container {
        gap: 0.3rem;
    }
    .main-content, .max-w-5xl, .slide-container-wrapper, .slide, .slide-content {
        padding: 0.05rem;
        min-height: 0;
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    .slide-container-wrapper {
        padding-bottom: 150px !important;
    }
    #chatButton {
        bottom: 200px !important;
        z-index: 60 !important;
    }
    #chatWidget {
        bottom: 220px !important;
        z-index: 60 !important;
    }
    .navigation {
        position: relative !important;
        bottom: auto !important;
        top: auto !important;
        transform: none !important;
        padding: 0.75rem 0 !important;
        gap: 0.5rem !important;
        justify-content: center !important;
        flex-direction: row !important;
        width: 100% !important;
        margin-top: 1rem !important;
    }
}

/* Hide tooltips on navigation buttons */
.nav-btn[data-tip]:hover::after {
    display: none;
}

.nav-btn[data-tip]:hover::before {
    display: none;
}

.navigation.hidden {
    display: none;
}

.slide-number-display.hidden {
    display: none;
}

/* Inline styles extracted from HTML */
@media (max-width: 768px) {
    nav {
        min-height: var(--nav-height);
        height: auto;
        padding: 0.75rem 1rem;
    }
    
    nav .container {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: flex-start;
        padding: 0.5rem 0;
        min-height: calc(var(--nav-height) - 1.5rem);
    }
    
    .slogan-container { 
        display: none !important;
    }
    
    .nav-links {
        display: none !important;
    }
    
    .hamburger {
        display: block !important;
    }
    
    .layout {
        margin-top: var(--nav-height);
        margin-bottom: var(--footer-height);
        min-height: calc(100vh - var(--nav-height) - var(--footer-height));
        height: calc(100vh - var(--nav-height) - var(--footer-height));
        padding-top: 10px; /* Extra breathing room for growing header */
    }
}

/* Medium screens - hide marquee to make room for nav links */
@media (max-width: 1200px) {
    .slogan-container {
        display: none !important;
    }
}

/* Simple mobile navigation - hide nav links, show hamburger */
@media (max-width: 767px) {
    .nav-links {
        display: none !important;
    }
    
    .hamburger {
        display: block !important;
    }
    
    /* Position floating elements closer together with transparency */
    #floatingHomeBtn {
        bottom: 120px !important;
        right: 20px !important;
        position: fixed !important;
        z-index: 1000 !important;
        background: rgba(73, 160, 120, 0.7) !important;
        backdrop-filter: blur(8px) !important;
        opacity: 0.8 !important;
    }
    
    #chatWidget {
        bottom: 70px !important;
        right: 20px !important;
        width: calc(100vw - 50px) !important;
        max-width: 280px !important;
        position: fixed !important;
        z-index: 999 !important;
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(8px) !important;
    }
}

/* Extra small screens - closer spacing */
@media (max-width: 480px) {
    #floatingHomeBtn {
        bottom: 110px !important;
        right: 15px !important;
        background: rgba(73, 160, 120, 0.6) !important;
        opacity: 0.7 !important;
    }
    
    #chatWidget {
        bottom: 60px !important;
        right: 15px !important;
        width: calc(100vw - 40px) !important;
        max-width: 260px !important;
        background: rgba(255, 255, 255, 0.85) !important;
    }
}

/* Very small screens - minimal spacing */
@media (max-width: 374px) {
    #floatingHomeBtn {
        bottom: 100px !important;
        right: 10px !important;
        background: rgba(73, 160, 120, 0.5) !important;
        opacity: 0.6 !important;
    }
    
    #chatWidget {
        bottom: 55px !important;
        right: 10px !important;
        width: calc(100vw - 30px) !important;
        max-width: 240px !important;
        background: rgba(255, 255, 255, 0.8) !important;
    }
}

/* Simple desktop navigation - show nav links, hide hamburger and floating button */
@media (min-width: 769px) {
    nav .container {
        flex-wrap: nowrap;
    }
    
    .slogan-container {
        font-size: 0.75rem;
    }
    
    .nav-links {
        display: flex !important;
    }
    
    .hamburger {
        display: none !important;
    }
    
    .mobile-nav-dropdown {
        display: none !important;
    }
    
    /* Hide floating button completely on desktop */
    #floatingHomeBtn {
        display: none !important;
    }
    
    /* Position chat widget away from navigation area */
    #chatWidget {
        bottom: 20px !important;
        right: 20px !important;
        width: 320px !important;
    }
}



/* Footer responsive styles for mobile */
@media (max-width: 768px) {
    .footer .container { 
        gap: 0.5rem !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .footer-home-link {
        display: inline-block !important;
        font-weight: 600;
        color: #256d4f !important;
        background: #fff;
        border-radius: 6px;
        padding: 0.3em 1.1em;
        margin-left: auto;
        margin-right: 0.1em;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        border: 1px solid #49A078;
        order: 99;
        min-width: 60px;
        text-align: center;
    }
    .footer-home-link:hover { 
        background: #49A078; 
        color: #fff !important; 
    }
    
    .footer-logo span {
        font-size: 0.8rem !important;
    }
    
    .footer-socials {
        gap: 0.75rem !important;
    }
}

@media (min-width: 769px) {
    .footer-home-link { 
        display: none !important; 
    }
}

/* Navigation feedback indicators */
.nav-feedback {
    position: fixed;
    top: 20px;
    transform: none;
    background: rgba(128, 128, 128, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: normal;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: 60px;
    text-align: center;
}

.nav-feedback.show {
    opacity: 1;
}

.nav-feedback.left {
    left: 10px;
}

.nav-feedback.right {
    right: 10px;
}

.nav-feedback i {
    font-size: 10px;
}

/* Enhanced slide transitions */
.slide-container-wrapper {
    touch-action: pan-y; /* Allow vertical scrolling but enable horizontal touch handling */
}

.slide {
    touch-action: pan-y;
}

/* Prevent text selection during swipes */
.slide-container-wrapper,
.slide,
.main-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Re-enable text selection for content elements */
.slide-content p,
.slide-content li,
.slide-content div {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ===== COMPREHENSIVE RESPONSIVE DESIGN ===== */

/* Extra small devices (phones, less than 375px) */
@media (max-width: 374px) {
    body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    nav {
        padding: 0.5rem;
        min-height: var(--nav-height);
        height: auto;
    }
    
    nav .container {
        gap: 0.25rem;
        flex-wrap: wrap;
        overflow: visible;
        align-items: flex-start;
        padding: 0.5rem 0;
        min-height: calc(var(--nav-height) - 1rem);
    }
    
    nav .container > * {
        flex-shrink: 1;
        min-width: 0;
    }
    
    .slogan-container {
        display: none !important;
        width: 0;
        min-width: 0;
        flex: 0 0 auto;
    }
    
    .layout {
        margin-top: var(--nav-height);
        margin-bottom: var(--footer-height);
        min-height: calc(100vh - var(--nav-height) - var(--footer-height));
        height: calc(100vh - var(--nav-height) - var(--footer-height));
        padding: 0;
        padding-top: 20px; /* Maximum extra space for header growth */
    }
    
    .sidebar.active {
        width: 100vw;
        top: var(--nav-height);
        height: calc(100vh - var(--nav-height) - var(--footer-height));
    }
    
    .mobile-nav-content {
        top: var(--nav-height) !important;
    }
    
    .slide-number-display {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.5rem !important;
        height: 8vh !important;
        min-height: 30px !important;
        line-height: 1.2 !important;
    }
    
    .slide {
        padding: 0.5rem 0.25rem !important;
        border-radius: 0 !important;
    }
    
    .slide-content {
        gap: 1.25rem !important;
        padding: 1rem !important;
    }
    
    .slide-content h2 {
        font-size: 1.5rem !important;
        margin-bottom: 0.875rem !important;
        line-height: 1.3 !important;
    }
    
    .slide-content p, .slide-content li {
        font-size: 1rem !important;
        line-height: 1.4 !important;
    }
    
    .highlight-list {
        padding-left: 1.5rem !important;
        margin: 0.5rem auto !important;
    }
    
    .highlight-list li {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
        padding-left: 0.25rem !important;
    }
    
    .ai-action-box {
        padding: 0.7rem !important;
        font-size: 0.8rem !important;
    }
    
    .navigation {
        padding: 0.3rem 0 !important;
        gap: 0.5rem !important;
    }
    
    .nav-btn {
        width: 28% !important;
        min-width: 80px !important;
        max-width: 120px !important;
        padding: 0.5rem 0.3rem !important;
        font-size: 0.8rem !important;
    }
    
    .footer {
        height: 45px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.65rem !important;
    }
    
    .footer .container {
        gap: 0.25rem !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .footer-logo span {
        font-size: 0.7rem !important;
    }
    
    .footer-socials {
        gap: 0.5rem !important;
    }
    
    .footer-link {
        font-size: 0.8rem !important;
    }
    
    .footer-copyright {
        font-size: 0.6rem !important;
        flex: 100% !important;
        text-align: center !important;
        margin-top: 0.2rem !important;
    }
    
    #chatButton, #chatWidget {
        right: 4px !important;
        scale: 0.9 !important;
    }
}

/* Small devices (phones, 375px to 576px) */
@media (min-width: 375px) and (max-width: 575px) {
    nav {
        min-height: var(--nav-height);
        height: auto;
        padding: 0.8rem;
    }
    
    nav .container {
        flex-wrap: wrap;
        gap: 0.4rem;
        align-items: flex-start;
        padding: 0.4rem 0;
        min-height: calc(var(--nav-height) - 1.6rem);
    }
    
    .layout {
        margin-top: var(--nav-height);
        margin-bottom: var(--footer-height);
        min-height: calc(100vh - var(--nav-height) - var(--footer-height));
        height: calc(100vh - var(--nav-height) - var(--footer-height));
        padding-top: 15px; /* Extra space for header growth */
    }
    
    .slide-number-display {
        font-size: 0.85rem !important;
        height: 9vh !important;
        min-height: 35px !important;
    }
    
    .slide-content h2 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    .slide-content p, .slide-content li {
        font-size: 1.05rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }
    
    .nav-btn {
        width: 30% !important;
        min-width: 90px !important;
        max-width: 140px !important;
        font-size: 0.9rem !important;
    }
    
    .footer {
        font-size: 0.7rem !important;
    }
}

/* Medium small devices (tablets, 576px to 768px) */
@media (min-width: 576px) and (max-width: 767px) {
    nav {
        min-height: var(--nav-height);
        height: auto;
        padding: 0.7rem 1rem;
    }
    
    nav .container {
        flex-wrap: wrap;
        gap: 0.6rem;
        align-items: flex-start;
        padding: 0.4rem 0;
        min-height: calc(var(--nav-height) - 1.4rem);
    }
    
    .layout {
        margin-top: var(--nav-height);
        margin-bottom: var(--footer-height);
        min-height: calc(100vh - var(--nav-height) - var(--footer-height));
        height: calc(100vh - var(--nav-height) - var(--footer-height));
        padding-top: 12px; /* Extra space for header growth */
    }
    
    .slide-number-display {
        font-size: 0.95rem !important;
        height: 10vh !important;
        min-height: 40px !important;
    }
    
    .slide {
        padding: 1rem 0.75rem !important;
    }
    
    .slide-content h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1.125rem !important;
    }
    
    .slide-content p, .slide-content li {
        font-size: 1.1rem !important;
        line-height: 1.7 !important;
        margin-bottom: 1rem !important;
    }
    
    .nav-btn {
        width: 32% !important;
        min-width: 110px !important;
        max-width: 160px !important;
        padding: 0.75rem !important;
        font-size: 1rem !important;
    }
}

/* Large tablets (768px to 992px) */
@media (min-width: 768px) and (max-width: 991px) {
    .sidebar {
        width: 260px !important;
    }
    
    .slide {
        padding: 1.5rem !important;
        max-width: 90% !important;
    }
    
    .slide-content h2 {
        font-size: 1.6rem !important;
    }
    
    .nav-btn {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.95rem !important;
    }
}

/* Large screens (992px to 1200px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .sidebar {
        width: 280px;
    }
    
    .slide {
        max-width: 85%;
        padding: 1.8rem;
    }
    
    .slide-content h2 {
        font-size: 1.7rem;
    }
}

/* Extra large screens (1200px and up) */
@media (min-width: 1200px) {
    .sidebar {
        width: 300px;
    }
    
    .slide {
        max-width: 900px;
        padding: 2.2rem;
    }
    
    .slide-content h2 {
        font-size: 1.8rem;
    }
}

/* Landscape orientation fixes */
@media (max-width: 768px) and (orientation: landscape) {
    :root {
        --nav-height: 70px; /* Reduced for landscape */
        --footer-height: 35px;
    }
    
    nav {
        padding: 0.4rem 1rem;
    }
    
    nav .container {
        padding: 0.2rem 0;
        min-height: calc(var(--nav-height) - 0.8rem);
    }
    
    .layout {
        margin-top: var(--nav-height);
        margin-bottom: var(--footer-height);
        min-height: calc(100vh - var(--nav-height) - var(--footer-height));
        height: calc(100vh - var(--nav-height) - var(--footer-height));
        padding-top: 5px; /* Minimal extra space in landscape */
    }
    
    .slide-number-display {
        height: 15vh !important;
        min-height: 35px !important;
        font-size: 0.8rem !important;
    }
    
    .slide {
        padding: 0.5rem !important;
    }
    
    .slide-content {
        gap: 0.75rem !important;
    }
    
    .slide-content h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .navigation {
        bottom: 0 !important;
        padding: 0.4rem 0 !important;
    }
    
    .nav-btn {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
    }
    
    .footer {
        height: 40px !important;
        font-size: 0.65rem !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .slide-content h2,
    .slide-content p,
    .slide-content li {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Prevent layout shifts and ensure responsive behavior */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.layout,
.main-content,
.slide-container-wrapper,
.slide {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ensure navigation doesn't interfere with content */
@media (min-width: 769px) {
    .slide {
        margin-right: 180px; /* Space for navigation */
    }
}

/* Text overflow protection */
.slide-content h2,
.slide-content p,
.slide-content li,
.footer-copyright {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Navigation feedback responsive */
@media (max-width: 768px) {
    .nav-feedback {
        font-size: 9px;
        padding: 2px 5px;
        top: 15px;
        max-width: 50px;
    }
    
    .nav-feedback i {
        font-size: 9px;
    }
    
    .nav-feedback.left {
        left: 8px;
    }
    
    .nav-feedback.right {
        right: 8px;
    }
}

/* Fix for very small height devices */
@media (max-height: 500px) {
    .slide-number-display {
        height: 8vh !important;
        min-height: 25px !important;
        font-size: 0.75rem !important;
    }
    
    .slide {
        padding: 0.5rem 0.25rem !important;
    }
    
    .slide-content h2 {
        font-size: 1rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .slide-content p, .slide-content li {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .navigation {
        position: relative !important;
        padding: 1rem 0 !important;
        gap: 0.75rem !important;
        justify-content: center !important;
        flex-direction: row !important;
        width: 100% !important;
        margin-top: 1rem !important;
    }
    
    .nav-btn {
        padding: 0.4rem !important;
        font-size: 0.75rem !important;
    }
    
    .footer {
        height: 35px !important;
        font-size: 0.6rem !important;
    }
}

/* Enhanced Navigation Styling for Big Screens */
@media (min-width: 769px) {
    .nav-links {
        display: flex !important;
        gap: 1.5rem;
        align-items: center;
    }
    
    .nav-link {
        white-space: nowrap;
        padding: 0.5rem 1rem;
        border-radius: 0.375rem;
        font-weight: 500;
        transition: all 0.3s ease;
        font-size: 0.95rem;
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #facc15;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .hamburger {
        display: none !important;
    }
    
    .slogan-container {
        display: flex !important;
        margin: 0 2rem;
        min-width: 350px;
        max-width: none;
        flex: 1;
    }
}

@media (min-width: 1025px) {
    .nav-links {
        gap: 2rem;
    }
    
    .nav-link {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .slogan-container {
        margin: 0 3rem;
        max-width: none;
        min-width: 400px;
        flex: 1;
    }
    
    /* Ensure no floating elements interfere with navigation on large screens */
    #floatingHomeBtn {
        display: none !important;
    }
}