:root {
    /* Light theme color palette */
    --light-bg: #f8f9fa;
    --light-bg-soft: #edf2f7;
    --light-bg-alt: #e2e8f0;
    --light-fg: #2d3748;
    --light-fg-alt: #4a5568;
    --light-primary: #3182ce;
    --light-secondary: #4299e1;
    --light-accent1: #2b6cb0;
    --light-accent2: #38a169;
    --light-accent3: #805ad5;
    --light-accent4: #dd6b20;
    --light-border: #cbd5e0;
    --light-shadow: rgba(0, 0, 0, 0.1);
    
    /* Current theme variables (will be overridden by dark mode) */
    --current-bg: var(--light-bg);
    --current-bg-soft: var(--light-bg-soft);
    --current-bg-alt: var(--light-bg-alt);
    --current-fg: var(--light-fg);
    --current-fg-alt: var(--light-fg-alt);
    --current-primary: var(--light-primary);
    --current-secondary: var(--light-secondary);
    --current-accent1: var(--light-accent1);
    --current-accent2: var(--light-accent2);
    --current-accent3: var(--light-accent3);
    --current-accent4: var(--light-accent4);
    --current-border: var(--light-border);
    --current-shadow: var(--light-shadow);
    
    /* Dark theme color palette */
    --dark-bg: #1a202c;
    --dark-bg-soft: #2d3748;
    --dark-bg-alt: #4a5568;
    --dark-fg: #f7fafc;
    --dark-fg-alt: #e2e8f0;
    --dark-primary: #63b3ed;
    --dark-secondary: #90cdf4;
    --dark-accent1: #4299e1;
    --dark-accent2: #68d391;
    --dark-accent3: #b794f6;
    --dark-accent4: #f6ad55;
    --dark-border: #4a5568;
    --dark-shadow: rgba(0, 0, 0, 0.3);
}

/* Dark theme overrides when explicitly set */
[data-theme="dark"] {
    --current-bg: var(--dark-bg);
    --current-bg-soft: var(--dark-bg-soft);
    --current-bg-alt: var(--dark-bg-alt);
    --current-fg: var(--dark-fg);
    --current-fg-alt: var(--dark-fg-alt);
    --current-primary: var(--dark-primary);
    --current-secondary: var(--dark-secondary);
    --current-accent1: var(--dark-accent1);
    --current-accent2: var(--dark-accent2);
    --current-accent3: var(--dark-accent3);
    --current-accent4: var(--dark-accent4);
    --current-border: var(--dark-border);
    --current-shadow: var(--dark-shadow);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --current-bg: var(--dark-bg);
        --current-bg-soft: var(--dark-bg-soft);
        --current-bg-alt: var(--dark-bg-alt);
        --current-fg: var(--dark-fg);
        --current-fg-alt: var(--dark-fg-alt);
        --current-primary: var(--dark-primary);
        --current-secondary: var(--dark-secondary);
        --current-accent1: var(--dark-accent1);
        --current-accent2: var(--dark-accent2);
        --current-accent3: var(--dark-accent3);
        --current-accent4: var(--dark-accent4);
        --current-border: var(--dark-border);
        --current-shadow: var(--dark-shadow);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--current-bg);
    color: var(--current-fg);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--current-primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--current-accent1);
}

.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 20px var(--current-shadow);
    transition: box-shadow 0.3s ease;
}

/* Header styles */
header {
    grid-area: header;
    background-color: var(--current-primary);
    padding: 1rem;
    box-shadow: 0 2px 4px var(--current-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Navigation Menu with Dropdowns */
.main-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    position: relative;
}

.main-menu > li {
    margin: 0 1.5rem;
    position: relative;
    padding: 0.5rem 0;
}

.main-menu li a {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    display: block;
    position: relative;
}

.main-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s;
}

.main-menu > li > a:hover::after {
    width: 100%;
}

.main-menu > li > a:hover {
    color: var(--current-bg-soft);
}

/* Make sure hover state is properly triggered */
.main-menu > li {
    margin: 0 1.5rem;
    position: relative;
    padding: 0.5rem 0;
}

/* Dropdown menu */
.dropdown, .submenu {
    position: absolute;
    background-color: var(--current-bg);
    border: 1px solid var(--current-border);
    min-width: 180px;
    box-shadow: 0 8px 16px var(--current-shadow);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: block;
    border-radius: 4px;
}

.dropdown {
    top: 100%;
    left: 0;
}

.has-dropdown:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    display: block;
}

.dropdown > li, .submenu > li {
    padding: 0;
    position: relative;
}

.dropdown > li > a, .submenu > li > a {
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--current-bg-soft);
    color: var(--current-fg);
}

.dropdown > li:last-child > a, .submenu > li:last-child > a {
    border-bottom: none;
}

.dropdown > li > a:hover, .submenu > li > a:hover {
    background-color: var(--current-bg-soft);
    color: var(--current-primary);
}

/* Submenu (third level) */
.submenu {
    left: 100%;
    top: 0;
    display: block;
}

.has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    display: block;
}

.has-submenu > a:after {
    content: '›';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Sidebar styles */
.sidebar {
    grid-area: sidebar;
    background-color: var(--current-bg-soft);
    padding: 1.5rem;
    border-right: 1px solid var(--current-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h2 {
    color: var(--current-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--current-border);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.news-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--current-border);
    transition: border-color 0.3s ease;
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: 0.8rem;
    color: var(--current-accent2);
    transition: color 0.3s ease;
}

.news-title {
    font-weight: 600;
    margin: 0.3rem 0;
}

.important-links ul {
    list-style: none;
}

.important-links ul li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.important-links ul li::before {
    content: '»';
    position: absolute;
    left: 0;
    color: var(--current-accent4);
    transition: color 0.3s ease;
}

/* Main content styles */
main {
    grid-area: main;
    padding: 2rem;
    background-color: var(--current-bg);
    transition: background-color 0.3s ease;
}

.main-content h1 {
    color: var(--current-primary);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    transition: color 0.3s ease;
}

.main-content h2 {
    color: var(--current-accent1);
    margin: 1.5rem 0 1rem;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.main-content h3 {
    color: var(--current-secondary);
    margin: 1.2rem 0 0.8rem;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

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

.main-content ul, .main-content ol {
    margin-bottom: 1rem;
    margin-left: 1.5rem;
}

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

.highlight {
    color: var(--current-accent1);
    font-weight: 600;
    transition: color 0.3s ease;
}

.cta-button {
    display: inline-block;
    background-color: var(--current-primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: var(--current-accent1);
    color: white;
    transform: translateY(-1px);
}

.service-card {
    background-color: var(--current-bg-soft);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--current-primary);
    position: relative;
    transition: all 0.3s ease;
}

.service-card h3 {
    color: var(--current-accent2);
    margin-top: 0;
    transition: color 0.3s ease;
}

.learn-more-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--current-primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--current-primary);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.learn-more-link:hover {
    background-color: var(--current-primary);
    color: white;
    transform: translateY(-1px);
}

/* Contact page styles */
.contact-info-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--current-bg-soft);
    border-radius: 5px;
    border-left: 4px solid var(--current-primary);
    transition: all 0.3s ease;
}

.contact-form-container {
    margin-top: 2rem;
}

.contact-form {
    max-width: 700px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--current-fg-alt);
    transition: color 0.3s ease;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--current-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--current-bg);
    color: var(--current-fg);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--current-primary);
    box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.2);
}

.form-group textarea {
    resize: vertical;
}

.submit-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--current-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background-color: var(--current-accent1);
    transform: translateY(-1px);
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.form-status.sending {
    background-color: var(--current-bg-soft);
    color: var(--current-primary);
    border-left: 4px solid var(--current-primary);
}

.form-status.success {
    background-color: var(--current-bg-soft);
    color: var(--current-accent2);
    border-left: 4px solid var(--current-accent2);
}

.form-status.error {
    background-color: var(--current-bg-soft);
    color: #e53e3e;
    border-left: 4px solid #e53e3e;
}

/* Service page specific styles */
.service-intro {
    font-size: 1.2rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: var(--current-bg-soft);
    border-radius: 5px;
    border-left: 4px solid var(--current-primary);
    transition: all 0.3s ease;
}

.service-description {
    margin: 2rem 0;
}

.service-feature {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: var(--current-bg-soft);
    border-radius: 5px;
    box-shadow: 0 2px 4px var(--current-shadow);
    transition: all 0.3s ease;
}

.service-feature h3 {
    color: var(--current-accent2);
    margin-top: 0;
    transition: color 0.3s ease;
}

.service-cta {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--current-bg-soft);
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 4px var(--current-shadow);
    transition: all 0.3s ease;
}

.service-cta .cta-button {
    margin-top: 1rem;
}

/* Home page specific styles */
.intro-section, .mission-section, .services-highlight {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--current-bg-soft);
    border-radius: 5px;
    box-shadow: 0 2px 4px var(--current-shadow);
    transition: all 0.3s ease;
}

.intro-section {
    border-left: 4px solid var(--current-primary);
}

.mission-section {
    border-left: 4px solid var(--current-accent3);
}

.services-highlight {
    border-left: 4px solid var(--current-accent2);
}

.cta-container {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.cta-button.secondary {
    background-color: var(--current-secondary);
}

.cta-button.secondary:hover {
    background-color: var(--current-accent1);
}

/* About page specific styles */
.vision-mission-section, .privacy-section, .concepts-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--current-bg-soft);
    border-radius: 5px;
    box-shadow: 0 2px 4px var(--current-shadow);
    transition: all 0.3s ease;
}

.vision-mission-section {
    border-left: 4px solid var(--current-accent4);
}

.privacy-section {
    border-left: 4px solid var(--current-accent3);
}

.concepts-section {
    border-left: 4px solid var(--current-primary);
}

.concept-card {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--current-bg);
    border-radius: 4px;
    box-shadow: 0 1px 3px var(--current-shadow);
    transition: all 0.3s ease;
}

.concept-card h3 {
    color: var(--current-accent2);
    margin-top: 0;
    transition: color 0.3s ease;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: translateY(0);
}

/* Navigation container for header layout */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--current-primary);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px var(--current-shadow);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--current-accent1);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "sidebar";
    }

    .sidebar {
        border-right: none;
        border-top: 1px solid var(--current-border);
    }
/*    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-menu {
        flex-direction: column;
        align-items: center;
    }
    
    .main-menu > li {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }
    .dropdown {
        position: static;
        width: 100%;
        display: none;
        opacity: 1;
        visibility: visible;
    }
    
    .has-dropdown:hover > .dropdown {
        display: block;
    }
    
    .submenu {
        position: static;
        width: 100%;
        display: none;
        box-shadow: none;
        border-left: 2px solid var(--current-accent2);
        opacity: 1;
        visibility: visible;
    }
    
    .has-submenu:hover > .submenu {
        display: block;
    }
    
    .cta-container {
        flex-direction: column;
    }
    
    .theme-toggle {
        margin-left: 0;
        margin-top: 0.5rem;
    }
  */
}
