:root {
    /* Minecraft Color Palette */
    --minecraft-dirt: #866043;      /* Base brown color */
    --minecraft-wood: #9b6b43;      /* Lighter brown */
    --minecraft-grass: #5d9d36;     /* Classic grass green */
    --minecraft-stone: #7a7a7a;     /* Stone grey */
    --minecraft-bedrock: #333333;   /* Dark grey */
    --minecraft-water: #2d5dcc;     /* Water blue */
    --minecraft-text: #ffffff;      /* White text */
    --minecraft-gold: #fccd58;      /* Gold accent */
    --minecraft-emerald: #17dd62;   /* Emerald accent */
    --minecraft-hover: #4e8130;     /* Darker grass for hover */
    --minecraft-shadow: rgba(0, 0, 0, 0.4);
}

@font-face {
    font-family: 'Minecrafter';
    src: url('../fonts/Minecrafter.woff2') format('woff2'),
        url('../fonts/Minecrafter.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Minecrafter Alt';
    src: url('../fonts/MinecrafterAlt.woff2') format('woff2'),
        url('../fonts/MinecrafterAlt.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Minecraftia';
    src: url('../fonts/Minecraftia-Regular.woff2') format('woff2'),
        url('../fonts/Minecraftia-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/NotoSans-Regular.woff2') format('woff2'),
        url('../fonts/NotoSans-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}



/* Base typography */
body {
    font-family: 'Minecraftia', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive container */
.container {
    display: flex;
    height: 100vh;
    flex-direction: row;
}

/* Responsive sidebar */
.sidebar {
    width: 300px;
    background: var(--minecraft-dirt);
    color: var(--minecraft-text);
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 4px solid var(--minecraft-wood);
    transition: transform 0.3s ease;
}

/* Responsive map container */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    height: 100vh;
}

#map {
    width: 100%;
    height: 100%;
    cursor: grab;  /* Default grab cursor */
}

#map.leaflet-drag-target,
#map.leaflet-dragging {
    cursor: grabbing !important;  /* Grabbing cursor when actively dragging */
}

/* Ensure the grab cursor doesn't show on markers and controls */
.leaflet-marker-icon,
.leaflet-control,
.leaflet-popup-content-wrapper {
    cursor: pointer !important;
}

/* Optional: Improve the dragging experience with smooth transitions */
.leaflet-tile-container {
    will-change: transform;
    transform-origin: 0 0;
}

/* Responsive typography */
h1 {
    font-size: clamp(24px, 4vw, 32px);
}

h2 {
    font-size: clamp(20px, 3vw, 24px);
}

h3 {
    font-size: clamp(16px, 2.5vw, 20px);
}

/* Form elements */
input, select, button {
    font-size: clamp(12px, 1.5vw, 14px);
    padding: clamp(6px, 1vw, 8px);
}

/* Main headings */
h1 {
    font-family: 'Minecrafter', Arial, sans-serif;
    font-size: 32px;
    letter-spacing: 2px;
    color: var(--minecraft-gold);
    text-shadow: 2px 2px var(--minecraft-shadow);
    margin-bottom: 20px;
}

/* Subheadings */
h2, h3, h4 {
    font-family: 'Minecrafter Alt', Arial, sans-serif;
    letter-spacing: 1px;
    color: var(--minecraft-gold);
    text-shadow: 2px 2px var(--minecraft-shadow);
    margin-bottom: 15px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 16px;
}

/* Buttons */
button {
    font-family: 'Minecraftia', Arial, sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 15px;
    background: var(--minecraft-grass);
    color: var(--minecraft-text);
    border: 2px solid var(--minecraft-stone);
    border-radius: 0;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

button:hover {
    background: var(--minecraft-hover);
}

.grid-overlay {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1;
    fill: none;
}

.grid-text {
    fill: var(--white);
    font-size: 12px;
}

#locationsList {
    margin-top: 10px;
}

.location-item {
    padding: 10px;
    background: var(--minecraft-wood);
    margin: 5px 0;
    border: 2px solid var(--minecraft-stone);
    cursor: pointer;
}

.location-item:hover {
    background: var(--minecraft-dirt);
}

/* Form focus states */
input:focus, select:focus {
    border-color: var(--minecraft-emerald);
    outline: none;
    box-shadow: 0 0 0 2px var(--minecraft-shadow);
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 12px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--minecraft-bedrock);
    border: 2px solid var(--minecraft-stone);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--minecraft-grass);
    border: 2px solid var(--minecraft-stone);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--minecraft-hover);
}

/* Color picker styling */
input[type="color"] {
    -webkit-appearance: none;
    padding: 0;
    width: 100%;
    height: 40px;
    margin: 5px 0;
    border: 1px solid var(--light-brown);
    border-radius: 4px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* Section headers */
.coordinate-finder h3,
.location-logger h3,
.saved-locations h3 {
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 5px;
}

/* Form groups */
.form-group {
    margin-bottom: 15px;
}

/* Success message */
.success-message {
    background: var(--minecraft-emerald);
    color: var(--minecraft-text);
    padding: 10px;
    border: 2px solid var(--minecraft-stone);
    margin-bottom: 10px;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

/* Error message */
.error-message {
    background: #a82c2c;
    color: var(--minecraft-text);
    padding: 10px;
    border: 2px solid var(--minecraft-stone);
    margin-bottom: 10px;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

/* Compass Rose Styles */
.compass-rose {
    background: var(--minecraft-dirt);
    padding: 10px;
    border: 2px solid var(--minecraft-stone);
}

.compass-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.compass-cardinal {
    position: absolute;
    color: var(--minecraft-text);
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

.compass-cardinal.north {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    color: var(--minecraft-emerald); /* Highlight north in green */
}

.compass-cardinal.south {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.compass-cardinal.east {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.compass-cardinal.west {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.compass-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: var(--minecraft-emerald);
    transform-origin: bottom center;
    transform: translateX(-50%) translateY(-50%) rotate(0deg);
}

.compass-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--minecraft-emerald);
}

/* Coordinate Label Styles */
.coordinate-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--minecraft-text);
    font-size: 12px;
    text-shadow: 2px 2px var(--minecraft-shadow);
    pointer-events: none;
    white-space: nowrap;
}

/* Adjust grid lines */
.leaflet-tile {
    border: 1px solid var(--minecraft-stone);
}

/* Form elements */
input, select {
    font-family: 'Minecraftia', Arial, sans-serif;
    font-size: 12px;
}

/* Location items */
.location-item {
    font-family: 'Minecraftia', Arial, sans-serif;
    font-size: 12px;
}

/* Compass cardinal directions */
.compass-cardinal {
    font-family: 'Minecrafter Alt', Arial, sans-serif;
    font-size: 12px;
}

/* Coordinate labels */
.coordinate-label {
    font-family: 'Minecraftia', Arial, sans-serif;
    font-size: 10px;
}

/* Messages */
.success-message,
.error-message {
    font-family: 'Minecraftia', Arial, sans-serif;
    font-size: 12px;
}

/* Form focus states */
input:focus, select:focus {
    border-color: var(--minecraft-emerald);
    outline: none;
    box-shadow: 0 0 0 2px var(--minecraft-shadow);
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 12px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--minecraft-bedrock);
    border: 2px solid var(--minecraft-stone);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--minecraft-grass);
    border: 2px solid var(--minecraft-stone);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--minecraft-hover);
}

/* Color picker styling */
input[type="color"] {
    -webkit-appearance: none;
    padding: 0;
    width: 100%;
    height: 40px;
    margin: 5px 0;
    border: 1px solid var(--light-brown);
    border-radius: 4px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* Section headers */
.coordinate-finder h3,
.location-logger h3,
.saved-locations h3 {
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 5px;
}

/* Form groups */
.form-group {
    margin-bottom: 15px;
}

/* Success message */
.success-message {
    background: var(--minecraft-emerald);
    color: var(--minecraft-text);
    padding: 10px;
    border: 2px solid var(--minecraft-stone);
    margin-bottom: 10px;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

/* Error message */
.error-message {
    background: #a82c2c;
    color: var(--minecraft-text);
    padding: 10px;
    border: 2px solid var(--minecraft-stone);
    margin-bottom: 10px;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

/* Compass Rose Styles */
.compass-rose {
    background: var(--minecraft-dirt);
    padding: 10px;
    border: 2px solid var(--minecraft-stone);
}

.compass-container {
    position: relative;
    width: 60px;
    height: 60px;
}

.compass-cardinal {
    position: absolute;
    color: var(--minecraft-text);
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px var(--minecraft-shadow);
}

.compass-cardinal.north {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    color: var(--minecraft-emerald); /* Highlight north in green */
}

.compass-cardinal.south {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.compass-cardinal.east {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.compass-cardinal.west {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.compass-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: var(--minecraft-emerald);
    transform-origin: bottom center;
    transform: translateX(-50%) translateY(-50%) rotate(0deg);
}

.compass-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--minecraft-emerald);
}

/* Coordinate Label Styles */
.coordinate-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--minecraft-text);
    font-size: 12px;
    text-shadow: 2px 2px var(--minecraft-shadow);
    pointer-events: none;
    white-space: nowrap;
}

/* Adjust grid lines */
.leaflet-tile {
    border: 1px solid var(--minecraft-stone);
}

/* Custom select styling */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    position: relative;
    background: var(--minecraft-bedrock);
    border: 2px solid var(--minecraft-stone);
    padding: 8px;
    cursor: pointer;
    color: var(--minecraft-text);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--minecraft-bedrock);
    border: 2px solid var(--minecraft-stone);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-select-option {
    padding: 8px;
    cursor: pointer;
}

.custom-select-option:hover {
    background: var(--minecraft-wood);
}

.custom-select-option i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.custom-select-optgroup {
    padding: 8px;
    font-weight: bold;
    background: var(--minecraft-dirt);
    color: var(--minecraft-gold);
}

/* Coordinate display styles */
.coordinate-label {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--minecraft-text);
    padding: 2px 4px;
    font-size: 10px;
    font-family: 'Minecraftia', monospace;
    pointer-events: none;
}

#coordDisplay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--minecraft-text);
    padding: 8px 12px;
    border: 2px solid var(--minecraft-stone);
    font-family: 'Minecraftia', monospace;
    z-index: 1000;
}

/* Tooltip styles */
.custom-tooltip {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--minecraft-stone);
    padding: 8px 12px;
    font-family: 'Minecraftia', monospace;
    color: var(--minecraft-text);
}

.marker-tooltip {
    font-size: 12px;
    line-height: 1.4;
}

/* Grid overlay styles */
.leaflet-tile {
    background: transparent !important;
}

.coordinate-label {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--minecraft-text);
    padding: 2px 4px;
    font-size: 10px;
    font-family: 'Minecraftia', monospace;
    pointer-events: none;
    white-space: nowrap;
}

/* Ensure grid lines are visible */
.leaflet-tile-container {
    opacity: 1 !important;
}

/* Media Queries */
/* Mobile devices */
@media screen and (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 4px solid var(--minecraft-wood);
    }

    .map-container {
        height: 60vh;
    }

    /* Collapsible sidebar for mobile */
    .sidebar-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        background: var(--minecraft-dirt);
        padding: 10px;
        border-radius: 4px;
        cursor: pointer;
    }

    .sidebar.collapsed {
        transform: translateY(-100%);
    }
}

/* Tablet devices */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }

    .location-item {
        font-size: 12px;
        padding: 8px;
    }
}

/* Larger screens */
@media screen and (min-width: 1025px) {
    .container {
        max-width: 1920px;
        margin: 0 auto;
    }
}

/* Responsive form layouts */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.coord-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

/* Responsive location items */
.location-item {
    padding: clamp(8px, 1.5vw, 10px);
    font-size: clamp(11px, 1.5vw, 12px);
}

/* Responsive coordinate labels */
.coordinate-label {
    font-size: clamp(8px, 1.2vw, 10px);
}

/* Responsive tooltips */
.custom-tooltip {
    font-size: clamp(10px, 1.2vw, 12px);
    padding: clamp(6px, 1vw, 8px);
}

/* Responsive compass rose */
.compass-rose {
    transform: scale(clamp(0.8, 1vw, 1));
    transform-origin: bottom right;
}

/* Ensure buttons remain clickable on touch devices */
button, 
.location-item,
.custom-select-wrapper {
    min-height: 44px;
    touch-action: manipulation;
}

/* Improve touch target sizes */
input[type="color"] {
    min-height: 44px;
}

/* Add smooth transitions */
.sidebar,
.map-container,
button,
.location-item {
    transition: all 0.3s ease;
}

/* Responsive scrollbars */
.sidebar::-webkit-scrollbar {
    width: clamp(8px, 1.5vw, 12px);
}

/* Add this to your HTML file */

/* Coordinate axes */
.coordinate-axes {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

.x-axis {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    height: 20px;
}

.z-axis {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 10px;
    width: 20px;
}

.coord-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Minecraftia', monospace;
    font-size: 12px;
    white-space: nowrap;
}

.x-label {
    transform: translateX(-50%);
}

.z-label {
    transform: translateY(-50%);
}

.coordinates-control {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'Minecraft', monospace;
    margin: 10px;
}

.leaflet-container {
    background-color: #1a1a1a !important;
}

.leaflet-tile-container {
    opacity: 1 !important;
}

.leaflet-tile {
    opacity: 1 !important;
}

#map {
    background-color: #1a1a1a;
    width: 100%;
    height: 100vh;
}

/* Loading and Error States */
.loading {
    padding: 1rem;
    text-align: center;
    color: var(--minecraft-text);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid var(--minecraft-text);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.error {
    padding: 1rem;
    text-align: center;
    color: #ff6b6b;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 4px;
}

.error button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--minecraft-stone);
    border: none;
    border-radius: 4px;
    color: var(--minecraft-text);
    cursor: pointer;
    transition: background 0.2s;
}

.error button:hover {
    background: var(--minecraft-bedrock);
}

/* Marker Popup Styles */
.marker-popup {
    padding: 0.5rem;
}

.marker-popup h3 {
    margin: 0 0 0.5rem 0;
    color: var(--minecraft-text);
    font-size: 1.2rem;
}

.marker-popup p {
    margin: 0.25rem 0;
    color: var(--minecraft-text);
}

.delete-location {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ff4444;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-location:hover {
    background: #cc0000;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Location List Item Styles */
.location-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.location-item:hover {
    background: rgba(0, 0, 0, 0.5);
}

.location-item i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.location-item strong {
    flex: 1;
    color: var(--minecraft-text);
}

.location-coords {
    color: var(--minecraft-stone);
    font-size: 0.9rem;
}

