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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #5E4955;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    padding: 40px;
    max-width: 800px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #5E4955;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #2A2B2A;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.instructions {
    background: #fff;
    border-left: 4px solid #978897;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.instructions h3 {
    color: #5E4955;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.instructions p {
    color: #2A2B2A;
    line-height: 1.6;
    margin-bottom: 10px;
}

.instructions p:last-child {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #5E4955;
    font-weight: 600;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fff;
    color: #2A2B2A;
}

input[type="text"]:focus {
    outline: none;
    border-color: #5E4955;
}

button {
    width: 100%;
    padding: 15px;
    background: #5E4955;
    color: #fff3ec;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s;
}

button:hover {
    transform: translateY(-2px);
    background: #4f3d47;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    color: #2A2B2A;
    margin-top: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #5E4955;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 10px;
    display: none;
}

.result.success {
    background: #e7f7f0;
    border: 1px solid #b0e0d3;
    color: #2A2B2A;
    display: block;
}

.result.address {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    color: #2A2B2A;
    display: block;
}

.result.error {
    background: #fbe6ec;
    border: 1px solid #f5c6cb;
    color: #5E4955;
    display: block;
}

.result.no-henge {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    display: block;
}

.result h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #5E4955;
}

.result p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.highlight {
    font-weight: 600;
    color: #996888;
}

.coordinates {
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    color: #2A2B2A;
}

.disclaimer {
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border-left: 3px solid #5E4955;
}

.disclaimer p {
    margin: 0;
    font-size: 0.9em;
    color: #2A2B2A;
    line-height: 1.4;
}

.disclaimer p:not(:last-child) {
    margin-bottom: 15px;
}

.disclaimer .topic {
    font-weight: 700;
    color: #5E4955;
    margin-bottom: 5px;
}

.map-container {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e1e5e9;
}

.step-instructions {
    background: #f8f9fa;
    padding: 15px;
    margin: 0 0 15px 0;
    border-left: 4px solid #DC816E;
    border-radius: 0 8px 8px 0;
}

.step-instructions p {
    margin: 0;
    color: #2A2B2A;
    line-height: 1.5;
    font-size: 0.95em;
}

#map {
    height: 500px;
    width: 100%;
    position: relative;
}

.compass-container {
    position: relative;
    padding: 0 30px;
}

.compass-marker {
    position: absolute;
    background: rgba(94, 73, 85, 0.9);
    color: white;
    font-weight: bold;
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.compass-north {
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
}

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

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

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

.map-info {
    background: #f8f9fa;
    padding: 10px;
    border-top: 1px solid #e1e5e9;
    font-size: 0.9em;
    color: #2A2B2A;
}

.bearing-controls {
    background: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.bearing-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bearing-value {
    font-weight: bold;
    color: #5E4955;
    font-size: 1.1em;
}

.bearing-buttons {
    display: flex;
    gap: 10px;
}

.bearing-btn {
    padding: 8px 12px;
    background: #5E4955;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.bearing-btn:hover {
    background: #4f3d47;
}

.bearing-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-btn {
    background: #6c757d;
}

.reset-btn:hover {
    background: #5a6268;
}

.main-action {
    margin-top: 20px;
    text-align: center;
}

.main-btn {
    padding: 18px 30px;
    background: #5E4955;
    color: #fff3ec;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s;
    min-width: 200px;
}

.main-btn:hover {
    transform: translateY(-2px);
    background: #4f3d47;
}

.main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner-hint {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* Interactive arrow styling */
.interactive-arrow {
    cursor: grab;
    transition: opacity 0.2s;
}

.interactive-arrow:hover {
    opacity: 1 !important;
}

.arrow-handle {
    cursor: grab;
}

body.grabbing {
    cursor: grabbing !important;
}

body.grabbing .interactive-arrow,
body.grabbing .arrow-handle {
    cursor: grabbing !important;
}

/* Toggle/Summary hover effects */
summary:hover {
    background-color: #e9ecef !important;
}

/* Tooltip styles */
.tooltip-term {
    color: #996888;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: help;
    position: relative;
    font-weight: 600;
}

.tooltip-term:hover {
    color: #5E4955;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #5E4955;
    color: #fff3ec;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    white-space: normal;
    width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s, visibility 0.2s;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #5E4955 transparent transparent transparent;
}

.tooltip-term:hover .tooltip {
    visibility: visible;
    opacity: 1;
}


/* Mobile block styles */
.mobile-block {
    display: none;
    min-height: 100vh;
    background: #5E4955;
    color: #fff3ec;
    padding: 40px 20px;
    text-align: center;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.mobile-block h1 {
    color: #fff3ec;
    margin-bottom: 20px;
    font-size: 2em;
}

.mobile-block p {
    font-size: 1.1em;
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 15px;
}

.mobile-block .icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.8;
}

/* Tab navigation styles */
.tab-navigation {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e1e5e9;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #2A2B2A;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #f8f9fa;
    transform: none;
}

.tab-button.active {
    color: #5E4955;
    border-bottom-color: #5E4955;
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Educational content styles */
.education-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #978897;
}

.education-section h2 {
    color: #5E4955;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.education-section h3 {
    color: #5E4955;
    margin-bottom: 10px;
    font-size: 1.3em;
    margin-top: 20px;
}

.education-section h3:first-of-type {
    margin-top: 0;
}

.education-section p {
    color: #2A2B2A;
    line-height: 1.6;
    margin-bottom: 15px;
}

.education-section ul {
    color: #2A2B2A;
    line-height: 1.6;
    margin-left: 20px;
    margin-bottom: 15px;
}

.education-section li {
    margin-bottom: 8px;
}

/* Street Henge Visualization */
.street-henge-container {
    background: #FFF;
    border-radius: 10px;
    margin: 30px 0;
    padding: 20px;
    position: relative;
}

.street-henge-canvas {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #FFE4B5 30%, #FFA07A 70%, #FF6347 100%);
}

.street-time-controls {
    margin-top: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.street-time-slider-container {
    margin: 15px 0;
}

.street-time-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.street-time-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5E4955;
    cursor: pointer;
}

.street-time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5E4955;
    cursor: pointer;
    border: none;
}

.street-time-display {
    color: #2A2B2A;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.street-time-labels {
    display: flex;
    justify-content: space-between;
    color: #2A2B2A;
    font-size: 14px;
    margin-top: 5px;
}

.henge-indicator {
    color: #FFB347;
    font-weight: bold;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.henge-indicator.visible {
    opacity: 1;
}