@charset "UTF-8";

body {
    font-family: Arial, sans-serif;
    margin-top: 30px;
    padding: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Prevent scrolling when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode #global_headerbar {
    background-color: #000000;
}

body.dark-mode .dropdown-menu {
    background-color: #111;
}

body.dark-mode .dropdown-menu a {
    color: #ccc;
}

body.dark-mode .dropdown-menu a:hover {
    background-color: #222;
    color: #4CAF50;
}

/* Hide/Show elements based on screen size */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* Global Header Bar */
#global_headerbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: #111111;
    z-index: 999999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Desktop Title */
#global_title {
    color: white;
    font-size: 22px;
    font-weight: bold;
    line-height: 30px;
    padding-left: 10px;
    padding-right: 20px;
}

#header_title_link {
    text-decoration: none;
    color: white;
}

#header_title_link:hover {
    color: #4c7aaf;
}

/* Mobile Header Styles */
.mobile-header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: space-between;
}

/* Mobile Hamburger Button */
.mobile-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 24px;
    z-index: 1000001;
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background-color: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    transform-origin: center;
    border: 2px solid white;
}

.mobile-hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Title */
.mobile-title {
    flex: 1;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.mobile-title-link {
    text-decoration: none;
    color: white;
}

.mobile-title-link:hover {
    color: #4c7aaf;
}

/* Mobile Dark Mode Switch */
.mobile-dark-mode {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-mode-icon {
    font-size: 14px;
    transition: opacity 0.3s ease;
    user-select: none;
}

.mobile-dark-mode-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.mobile-dark-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mobile-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 20px;
    transition: 0.3s;
}

.mobile-switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .mobile-switch-slider {
    background-color: #4CAF50;
}

input:checked + .mobile-switch-slider:before {
    transform: translateX(16px);
}

/* Mobile Overlay Menu */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 30px;
    left: 0;
    width: 280px;
    height: calc(100% - 30px);
    background-color: #111;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px 0;
}

.mobile-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* Mobile Menu Sections */
.mobile-menu-section {
    border-bottom: 1px solid #333;
}

.mobile-menu-category {
    width: 100%;
    background: none;
    border: none;
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.mobile-menu-category:hover {
    background-color: #222;
}

.mobile-dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.mobile-submenu {
    background-color: #1a1a1a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.active {
    max-height: 400px;
}

.mobile-submenu a {
    display: block;
    padding: 12px 40px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.mobile-submenu a:hover {
    background-color: #333;
    border-left: 3px solid #4CAF50;
    color: white;
}

.mobile-help-about {
    display: block;
    width: 100%;
    padding: 16px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    transition: background-color 0.3s ease;
}

.mobile-help-about:hover {
    background-color: #222;
    color: #4CAF50;
}

/* Desktop Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Desktop Dark Mode Switch Container */
.dark-mode-switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-icon {
    font-size: 16px;
    transition: opacity 0.3s ease;
    user-select: none;
}

.sun-icon {
    opacity: 1;
}

.moon-icon {
    opacity: 0.5;
}

/* Desktop Dark Mode Switch Styles */
.dark-mode-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.dark-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .switch-slider {
    background-color: #4CAF50;
}

input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.switch-slider:hover {
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.help-about-link {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.help-about-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #4CAF50;
    text-decoration: none;
}

/* Desktop Global Navigation Styles */
.global-nav-container {
    position: relative;
    margin-left: 10px;
    flex: 1;
}

.global-nav {
    display: flex;
    align-items: center;
    height: 30px;
}

.global-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* Desktop Menu Item Styling */
.menu-item {
    position: relative;
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-item a {
    color: white;
    text-decoration: none;
    padding: 0 12px;
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 15px;
    transition: background-color 0.3s;
}

.menu-item a:hover {
    background-color: #333;
    color: #4CAF50;
}

/* Desktop Dropdown Styling */
.has-dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 8px;
    margin-left: 5px;
    vertical-align: middle;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #222;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-out;
    z-index: 100;
    padding: 5px 0;
    list-style: none;
    margin: 0;
}

.has-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    padding: 0;
    width: 100%;
}

.dropdown-menu a {
    padding: 8px 15px;
    font-size: 14px;
    color: #ddd;
    border-left: 3px solid transparent;
    display: block;
    height: auto;
}

.dropdown-menu a:hover {
    background-color: #333;
    border-left: 3px solid #4CAF50;
}

/* Dark Mode Adjustments for Mobile */
body.dark-mode .mobile-overlay {
    background-color: rgba(0, 0, 0, 0.9);
}

body.dark-mode .mobile-menu-content {
    background-color: #000;
}

body.dark-mode .mobile-menu-section {
    border-bottom-color: #222;
}

body.dark-mode .mobile-submenu {
    background-color: #111;
}

body.dark-mode .mobile-submenu a:hover {
    background-color: #222;
}

body.dark-mode .mobile-menu-category:hover,
body.dark-mode .mobile-help-about:hover {
    background-color: #111;
}

/* Disclaimer footer */
.disclaimer-footer {
    width: 100%;
    max-width: 800px;
    margin: 40px auto 20px;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 14px;
    color: #666;
}

body.dark-mode .disclaimer-footer {
    border-top: 1px solid #333;
    color: #ccc;
}

.footer-content {
    padding: 0 15px;
}

.disclaimer-footer a {
    color: #4CAF50;
    text-decoration: none;
}

.disclaimer-footer a:hover {
    text-decoration: underline;
}

.disclaimer-text {
    margin-top: 5px;
    font-size: 12px;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .global-nav-container {
        margin-left: 5px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .help-about-link {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .dark-mode-switch {
        width: 40px;
        height: 22px;
    }
    
    .switch-slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .switch-slider:before {
        transform: translateX(18px);
    }
    
    .mode-icon {
        font-size: 14px;
    }
    
    .menu-item a {
        padding: 0 8px;
        font-size: 13px;
    }
}

/* Desktop and Mobile Layout Containers */
.desktop-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.mobile-layout {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: space-between;
}

/* Ensure proper hiding/showing */
@media (max-width: 768px) {
    .desktop-layout {
        display: none !important;
    }
    
    .mobile-layout {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    .desktop-layout {
        display: flex !important;
    }
    
    .mobile-layout {
        display: none !important;
    }
}