:root {
    --primary-color: #0057A7; /* Główny niebieski z logo */
    --accent-color: #FFDD00;  /* Żółty akcent z logo */
    --cta-button-text-color: #FFFFFF; /* Biały tekst dla przycisków CTA */
    --secondary-color: #6c757d; /* Zachowany, ale mniej używany */
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* Kolory tła i tekstu - zwiększona przezroczystość */
    --background-dark: rgba(0, 31, 63, 0.75); /* Ciemnoniebieskie tło (tryb ciemny), bardziej przezroczyste */
    --text-dark: #e0e0e0;
    --background-light: rgba(255, 255, 255, 0.75); /* Białe tło (tryb jasny), bardziej przezroczyste */
    --text-light: #212529;
    
    /* Dostosowane kolory glassmorfizmu */
    --glass-bg-dark: rgba(0, 40, 80, 0.65); /* Ciemnoniebieski przezroczysty dla szkła w trybie ciemnym */
    --glass-border-dark: rgba(255, 221, 0, 0.25); /* Subtelna żółta ramka dla szkła w trybie ciemnym */
    --glass-bg-light: rgba(230, 245, 255, 0.65); /* Bardzo jasnoniebieski przezroczysty dla szkła w trybie jasnym */
    --glass-border-light: rgba(0, 87, 167, 0.3); /* Subtelna niebieska ramka dla szkła w trybie jasnym */
}

html {
    /* Usunięto style dla tła GIF */
    height: 100%;
}

#global-background-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -10; /* Upewnij się, że jest za wszystkimi innymi elementami */
    transform: translateX(-50%) translateY(-50%);
    background-size: cover;
    object-fit: cover; /* Dodano dla lepszego dopasowania wideo */
}

#global-background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Ciemna warstwa z 60% nieprzezroczystością */
    z-index: -9; /* Nad wideo, ale pod resztą zawartości */
    pointer-events: none; /* Nie blokuje interakcji z innymi elementami */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100%; /* Ensure body takes at least full height */
    position: relative; /* Required for stacking context if needed, good practice */
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

body.light-mode {
    background-color: var(--background-light);
    color: var(--text-light);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0,0,0,0.3); /* Semi-transparent background for header */
    backdrop-filter: blur(5px); /* Glassmorphism for header */
    transition: background 0.3s ease; /* Smooth transition */
}

/* Light mode header - white background */
body.light-mode header {
    background: rgba(255,255,255,0.9); /* White semi-transparent background */
    backdrop-filter: blur(5px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem; /* Reduced padding for tighter layout */
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: nowrap; /* Prevent wrapping */
    gap: 3rem; /* Increased gap to push elements further apart */
}

.logo {
    display: flex;
    align-items: center;
    min-width: 0; /* Allow shrinking if space is tight */
    flex-shrink: 0; /* Prevent logo from shrinking too much */
    max-width: 350px; /* Slightly reduced max-width */
    margin-right: auto; /* Push logo to the left */
    padding-left: 0; /* Remove any left padding */
}

.logo img {
    /* Style for both logos */
    width: auto;
    height: 90px; /* Keep current size */
    max-width: 135px; /* Keep current size */
    object-fit: contain;
    margin-right: 6px; /* Further reduced space between logos */
}

.logo img:last-of-type {
    margin-right: 0; /* Remove margin from the last logo */
}

.logo span {
    font-size: 1.05rem; /* Slightly smaller font */
    font-weight: bold;
    white-space: nowrap;
    margin-left: 8px; /* Reduced space between image and text */
    flex-shrink: 0; /* Prevent span from being squished */
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0.7rem; /* Further reduced gap for more compact menu */
    margin: 0;
    padding: 0;
    flex-shrink: 1; /* Allow menu to shrink if needed */
    min-width: 0;
    margin-left: auto; /* Push menu to the right */
    padding-right: 0; /* Remove any right padding */
}

nav ul li a {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem; /* Even smaller font for more compact menu */
    transition: color 0.3s ease, background-color 0.3s ease; /* Dodano transition dla background */
    white-space: nowrap;
    padding: 0.4rem 0.4rem; /* Further reduced padding for more compact menu */
    border-radius: 4px; /* Dodano border-radius dla lepszego efektu hover */
}

body.dark-mode nav ul li a {
    color: var(--text-dark);
}

body.light-mode nav ul li a {
    color: var(--text-light);
}

nav ul li a:hover {
    color: var(--primary-color); /* Zmieniono na kolor podstawowy (niebieski) dla wyróżnienia menu */
    background-color: rgba(0, 87, 167, 0.1); /* Subtelne niebieskie tło przy hover */
    border-radius: 4px; /* Lekko zaokrąglone rogi */
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem; /* Smaller for more compact layout */
    transition: color 0.3s ease, background-color 0.3s ease; /* Dodano transition dla background */
    flex-shrink: 0; /* Don't let button shrink */
    padding: 0.3rem; /* Reduced padding */
    min-width: 35px; /* Smaller minimum touch target */
    margin-left: 0.3rem; /* Reduced margin from menu */
    border-radius: 4px; /* Dodano border-radius dla lepszego efektu hover */
}

body.dark-mode #theme-toggle {
    color: var(--text-dark);
}

body.light-mode #theme-toggle {
    color: var(--text-light);
}

#theme-toggle:hover {
    color: var(--primary-color); /* Zmieniono na kolor podstawowy (niebieski) dla spójności */
    background-color: rgba(0, 87, 167, 0.1); /* Subtelne niebieskie tło przy hover */
    border-radius: 4px; /* Lekko zaokrąglone rogi */
}

main {
    padding-top: 80px; /* Adjust based on header height */
}

section {
    padding: 4rem 2rem;
    max-width: 1000px;
    margin: 2rem auto;
    border-radius: 15px;
}

.glass-section {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    transition: background 0.3s, border 0.3s;
}

body.light-mode .glass-section {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border-light);
}

#hero {
    /* background: url('placeholder-hero-bg.jpg') no-repeat center center/cover; */ /* Usunięto placeholder */
    position: relative; 
    overflow: hidden; 
    color: white;
    text-align: center;
    padding: 6rem 2rem;
    border-radius: 0;
    margin: 0 auto;
    max-width: none;
}

.hero-content {
    background: rgba(0, 0, 0, 0.5); /* Dark overlay for text readability */
    padding: 2rem;
    border-radius: 10px;
    display: inline-block;
}

#hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--cta-button-text-color);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--accent-color);
    color: var(--primary-color); /* Tekst przycisku staje się niebieski na żółtym tle */
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.service-card {
    padding: 1.5rem;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.service-card:hover i {
    color: var(--accent-color);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

#contact p {
    line-height: 1.8;
    text-align: center;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid;
}

body.dark-mode footer {
    border-top-color: var(--glass-border-dark);
}

body.light-mode footer {
    border-top-color: var(--glass-border-light);
}

footer a {
    text-decoration: none;
}

body.dark-mode footer a {
    color: var(--accent-color);
}

body.light-mode footer a {
    color: var(--primary-color);
}

footer a:hover {
    text-decoration: underline;
}

/* Slideshow styles */
.slideshow-container {
    width: 100%;
    position: relative;
    margin: auto;
    text-align: center; /* Center the images if they're smaller than the container */
}

.gallery-dual-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.gallery-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: opacity 1s ease-in-out, transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Responsive adjustments for gallery */
@media (max-width: 768px) {
    .gallery-dual-images {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .gallery-image {
        height: 250px;
    }
}

/* Contact executives styling */
.contact-executives {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.executive-contact {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border-dark);
}

body.light-mode .executive-contact {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--glass-border-light);
}

.executive-contact p {
    margin: 0.5rem 0;
}

.executive-contact p:first-child {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

/* Responsive adjustments for executives */
@media (max-width: 768px) {
    .contact-executives {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Privacy Policy specific styles */
.policy-section {
    margin: 1.5rem 0;
    padding: 1rem;
    border-left: 3px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 8px 8px 0;
}

.policy-section h3 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.policy-section ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.policy-section li {
    margin: 0.3rem 0;
    line-height: 1.6;
}

.policy-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border-dark);
    text-align: center;
}

body.light-mode .policy-footer {
    border-top-color: var(--glass-border-light);
}

body.light-mode .policy-section {
    background: rgba(0, 0, 0, 0.05);
}

/* Board members styling */
.board-members {
    margin-top: 1rem;
}

.board-members h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border-dark);
    padding-bottom: 0.5rem;
}

body.light-mode .board-members h3 {
    border-bottom-color: var(--glass-border-light);
}

.board-contacts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.board-contact {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border-dark);
    border-left: 3px solid var(--accent-color);
}

body.light-mode .board-contact {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--glass-border-light);
    border-left-color: var(--accent-color);
}

.board-contact p {
    margin: 0.4rem 0;
    font-size: 0.9rem;
}

.board-contact p:first-child {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

/* Responsive adjustments for board members */
@media (max-width: 768px) {
    .board-contacts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Legacy responsive adjustments - Updated to work with enhanced mobile design */
@media (max-width: 768px) {
    /* Basic fallbacks for older browsers */
    .service-cards {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Mobile and Responsive Design */

/* Partners section styling */
.partner-logos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.partner-logo {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
}

body.light-mode .partner-logo {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--glass-border-light);
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.partner-logo a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.partner-logo img {
    max-width: 200px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.partner-logo h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem 0;
}

.partner-logo p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

body.dark-mode .partner-logo p {
    color: var(--text-dark);
}

body.light-mode .partner-logo p {
    color: var(--text-light);
}

/* Locations section styling */
.locations-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.location-item {
    padding: 2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border-dark);
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

body.light-mode .location-item {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--glass-border-light);
}

.location-item h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.location-item p {
    margin: 0.5rem 0;
    line-height: 1.6;
    word-wrap: break-word;
}

.map-container {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    width: 100%;
    max-width: 100%;
}

.map-container iframe {
    width: 100%;
    height: 250px;
    border: none;
    display: block;
    max-width: 100%;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.map-link:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.map-link i {
    font-size: 0.9rem;
}

/* Social media section styling */
.social-media-section {
    margin-top: 2rem;
    text-align: center;
}

.social-media-section h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #0077B5; /* LinkedIn blue */
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    min-width: 120px;
    justify-content: center;
    box-sizing: border-box;
}

.social-link:hover {
    background-color: #005885;
    transform: translateY(-2px);
}

.social-link i {
    font-size: 1.2rem;
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    /* Header and Navigation */
    nav {
        padding: 0.5rem 0.5rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
        margin-right: 0;
        margin-bottom: 0.5rem;
        max-width: 100%;
    }
    
    .logo img {
        height: 60px;
        max-width: 90px;
    }
    
    .logo span {
        font-size: 0.9rem;
        margin-left: 6px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-left: 0;
    }
    
    nav ul li a {
        font-size: 0.75rem;
        padding: 0.3rem 0.3rem;
    }
    
    #theme-toggle {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1rem;
    }
    
    /* Main content padding adjustment */
    main {
        padding-top: 120px; /* More space for larger mobile header */
    }
    
    /* Hero section */
    #hero {
        padding: 4rem 1rem;
    }
    
    #hero h1 {
        font-size: 2rem;
    }
    
    #hero p {
        font-size: 1rem;
    }
    
    .hero-content {
        padding: 1.5rem;
    }
    
    /* Sections */
    section {
        padding: 2.5rem 1rem;
        margin: 1rem auto;
    }
    
    h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    /* Service cards - single column on mobile */
    .service-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1.2rem;
    }
    
    /* Gallery */
    .gallery-dual-images {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    /* Partners - single column */
    .partner-logos {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .partner-logo {
        padding: 1.5rem;
    }
    
    .partner-logo img {
        max-width: 150px;
        max-height: 80px;
    }
    
    /* Locations */
    .locations-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .location-item {
        padding: 1rem;
    }
    
    .map-container iframe {
        height: 200px;
    }
    
    /* Contact section */
    .contact-executives {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .board-contacts {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    /* Social media */
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .social-link {
        padding: 0.6rem 1rem;
        width: 200px;
        justify-content: center;
    }
    
    /* Footer */
    footer {
        padding: 1.5rem 0.5rem;
        text-align: center;
    }
    
    footer p {
        font-size: 0.85rem;
        line-height: 1.6;
    }
}

/* Small devices (landscape phones, 576px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    nav {
        padding: 0.5rem 1rem;
        gap: 2rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .logo {
        margin-right: auto;
        margin-bottom: 0;
        justify-content: flex-start;
    }
    
    .logo img {
        height: 75px;
        max-width: 112px;
    }
    
    .logo span {
        font-size: 1rem;
    }
    
    nav ul {
        margin-left: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    
    nav ul li a {
        font-size: 0.75rem;
        padding: 0.35rem 0.35rem;
    }
    
    #theme-toggle {
        position: static;
        margin-left: 0.3rem;
    }
    
    main {
        padding-top: 80px;
    }
    
    section {
        padding: 3rem 1.5rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    /* Service cards - 2 columns on tablet */
    .service-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    /* Partners - 2 columns on tablet */
    .partner-logos {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Gallery stays as dual images but smaller */
    .gallery-image {
        height: 220px;
    }
}

/* Medium devices (tablets, 768px to 992px) */
@media (min-width: 769px) and (max-width: 992px) {
    nav {
        padding: 0.5rem 1.5rem;
        gap: 2.5rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .logo {
        margin-right: auto;
        margin-bottom: 0;
        justify-content: flex-start;
    }
    
    .logo img {
        height: 80px;
        max-width: 120px;
    }
    
    nav ul {
        margin-left: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    
    #theme-toggle {
        position: static;
        margin-left: 0.3rem;
    }
    
    main {
        padding-top: 80px;
    }
    
    section {
        padding: 3.5rem 2rem;
        max-width: 900px;
    }
    
    /* Service cards - 2 columns on tablet */
    .service-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Partners - all 3 in a row but smaller */
    .partner-logos {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .partner-logo {
        padding: 1.5rem;
    }
    
    .partner-logo img {
        max-width: 160px;
        max-height: 85px;
    }
}

/* Large devices (desktops, 992px and up) - default styles apply */
@media (min-width: 993px) {
    /* Ensure optimal viewing on larger screens */
    .slideshow-container {
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .partner-logos {
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .locations-container {
        max-width: 1000px;
        margin: 0 auto;
    }
    
    /* Ensure desktop navigation layout is correct */
    nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        gap: 3rem;
        text-align: left;
    }
    
    .logo {
        margin-right: auto;
        margin-bottom: 0;
        justify-content: flex-start;
    }
    
    nav ul {
        margin-left: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    
    #theme-toggle {
        position: static;
        margin-left: 0.3rem;
    }
    
    main {
        padding-top: 80px; /* Standard desktop header height */
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    main {
        padding-top: 100px;
    }
    
    #hero {
        padding: 3rem 1rem;
    }
    
    #hero h1 {
        font-size: 2.2rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    .gallery-image {
        height: 180px;
    }
}

/* Mobile video background optimizations */
@media (max-width: 768px) {
    #global-background-video {
        /* Reduce video quality impact on mobile performance */
        transform: translateX(-50%) translateY(-50%) scale(1.1);
    }
    
    #global-background-overlay {
        /* Slightly darker overlay on mobile for better text readability */
        background-color: rgba(0, 0, 0, 0.75);
    }
}

/* Mobile device specific optimizations */
.mobile-device {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.mobile-device .partner-logos {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.mobile-device .partner-logo {
    padding: 1.5rem;
    max-width: 100%;
}

.mobile-device .partner-logo img {
    max-width: 150px;
    max-height: 80px;
}

.mobile-device .locations-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.mobile-device .location-item {
    padding: 1.5rem;
}

.mobile-device .map-container iframe {
    height: 200px;
}

.mobile-device .contact-executives,
.mobile-device .board-contacts {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mobile-device .social-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mobile-device .social-link {
    width: 80%;
    max-width: 250px;
    justify-content: center;
}

/* Desktop device optimizations */
.desktop-device .partner-logos {
    grid-template-columns: repeat(3, 1fr);
}

.desktop-device .locations-container {
    grid-template-columns: 1fr 1fr;
}

.desktop-device .contact-executives,
.desktop-device .board-contacts {
    grid-template-columns: 1fr 1fr;
}

/* Optimize for touch devices */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .partner-logo:hover,
    .location-item:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    /* Make buttons and links more touch-friendly */
    .cta-button,
    .map-link,
    .social-link {
        min-height: 44px; /* Apple's recommended minimum touch target */
        padding: 0.8rem 1.2rem;
    }
    
    nav ul li a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
