body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #333333;
}

#mindmap-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.actions-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.main-action-button {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.main-action-button::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;
}

.main-action-button:hover::before {
    left: 100%;
}

.main-action-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.actions-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop hover behavior */
@media (hover: hover) and (pointer: fine) {
    .actions-menu:hover .actions-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Mobile tap behavior */
@media (hover: none) and (pointer: coarse) {
    .actions-menu.expanded .actions-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.actions-submenu button {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.actions-submenu button::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;
}

.actions-submenu button:hover::before {
    left: 100%;
}

.actions-submenu button:active {
    transform: translateY(-1px) scale(0.98);
}

#save-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#save-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

#load-button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#load-button:hover {
    background: linear-gradient(135deg, #43a3f5 0%, #00d4ff 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

#join-maps-button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#join-maps-button:hover {
    background: linear-gradient(135deg, #0f8a7e 0%, #32d66a 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(56, 239, 125, 0.4);
}

#reset-map-button {
    background: linear-gradient(135deg, #f85032 0%, #e73827 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#reset-map-button:hover {
    background: linear-gradient(135deg, #e84022 0%, #d72817 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(248, 80, 50, 0.4);
}

#help-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#help-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

#demo-map-button {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    opacity: 1;
    animation: float 2s ease-in-out infinite, pulse 3s ease-in-out infinite;
    position: relative;
    border: 1px solid rgba(252, 182, 159, 0.3);
}

#demo-map-button:hover {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 236, 210, 0.4);
    animation-play-state: paused;
}


@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 4px 15px rgba(252, 182, 159, 0.3);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 6px 20px rgba(252, 182, 159, 0.6);
    }
}


#help-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #2d3748;
    max-width: 320px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom left;
}

#help-text.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none; /* Disable interactions when hidden */
}

#help-text h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.1); /* Softer border */
    padding-bottom: 5px;
}

#help-text ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.6; /* Improved readability */
}

#help-text li {
    margin-bottom: 5px;
}

#help-toggle-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: #607d8b; /* Professional grey-blue */
    color: white;
    border: none;
    border-radius: 50%; /* Circular button */
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 1000;
}

#help-toggle-button:hover {
    background-color: #455a64;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#context-help {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: #2d3748;
    max-width: 220px;
    min-width: 160px;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#context-help-content {
    line-height: 1.3;
}

#context-help-content .help-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 12px;
}

#context-help-content .help-item {
    margin-bottom: 2px;
    color: #666;
}

#context-help-content .help-key {
    font-weight: 500;
    color: #444;
}