/* General mobile styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-color: #bbbbbb;
    -webkit-text-size-adjust: 100%; /* Prevents iOS font size increase on landscape */
}

/* Header and navigation */
header {
    background-color: #333;
    color: white;
    padding: 10px 5px;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap on very small screens */
}

header nav ul li {
    margin: 0 5px;
}

header nav ul li a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
    padding: 5px;
    display: block;
}

header nav ul li a.selected {
    color: #906161;
}

header nav ul li a:hover {
    color: #906161;
}

/* Main container - stacks vertically */
.container {
    display: flex;
    flex-direction: column; /* This is the key change for mobile */
}

/* Menus - now full width */
aside, .right-menu {
    width: 100%;
    background-color: #f4f4f4;
    padding: 10px;
    box-sizing: border-box;
    border: none;
    border-bottom: 2px solid #ccc;
}

.right-menu {
    order: 2; /* Show right menu content above the map */
}

aside {
    order: 3; /* Show left menu content below the map */
}

main {
    order: 1; /* Show map at the top */
    width: 100%;
}

/* Canvas - takes full width */
canvas {
    width: 100%;
    height: auto; /* Height will be set by JS to maintain aspect ratio */
    display: block;
    border: none;
    cursor: crosshair;
}


/* Make buttons larger and more touch-friendly */
.side-menu li button, .right-menu li button, .session-controls button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #808080;
    color: #f5f5f5;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 1);
    font-size: 16px;
}

.side-menu li button:hover, .right-menu li button:hover, .session-controls button:hover {
    background-color: #906161;
}

.side-menu li button.selected {
    background-color: #906161;
    border: 1px solid #f5f5f5;
}

/* Input fields */
.session-controls input[type="text"],
.session-controls input[type="password"],
.right-menu select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Headings */
.right-menu h2, aside h3, .menu-section h3 {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ccc;
}

.right-menu ul,
aside ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

#refreshMapBtn {
    margin-top: 5px;
}