:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

.notification-success {
    background-color: var(--success-color);
    color: white;
}

.notification-error {
    background-color: var(--danger-color);
    color: white;
}

.notification-warning {
    background-color: var(--warning-color);
    color: white;
}

.notification-info {
    background-color: var(--primary-color);
    color: white;
}

.notification-hide {
    animation: slideUp 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

header {
    background-color: var(--card-bg);
    padding: 15px 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
}

.stats {
    display: flex;
    gap: 25px;
    font-size: 0.95rem;
}

.stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #e5e7eb;
}

/* Info panel - top left */
.info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 400;
    backdrop-filter: blur(10px);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hint {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.instruction {
    font-size: 0.85rem;
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    margin: 0;
}

/* Guess panel - bottom left */
.guess-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 400;
    backdrop-filter: blur(10px);
}

.guess-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.guess-info {
    margin-bottom: 12px;
    padding: 10px;
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.guess-info p {
    font-size: 0.85rem;
    margin: 4px 0;
}

.guess-info p:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.guess-info p:last-child {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 500;
}

#noGuessText {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Attempt items styling */
.attempt-item {
    background-color: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning-color);
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.attempt-item:last-child {
    margin-bottom: 0;
}

#attemptsList {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    max-height: none;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-secondary);
    color: white;
}

.btn.full-width {
    width: 100%;
}

.button-group {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.results {
    margin-top: 30px;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border-left: 5px solid var(--success-color);
}

.results.hidden {
    display: none;
}

.result-content h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.result-content > p {
    font-size: 1rem;
    margin-bottom: 10px;
    padding: 5px 0;
}

#resultTitle {
    color: var(--success-color);
}

#distance {
    font-size: 1.1rem;
    font-weight: 600;
}

#accuracy {
    font-weight: 600;
    padding: 10px;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-box {
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-box p:first-child {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.info-box p:last-child {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.results {
    margin-top: 30px;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border-left: 5px solid var(--success-color);
}

.results.hidden {
    display: none;
}

.result-content h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.result-content > p {
    font-size: 1rem;
    margin-bottom: 10px;
    padding: 5px 0;
}

#resultTitle {
    color: var(--success-color);
}

#distance {
    font-size: 1.1rem;
    font-weight: 600;
}

#accuracy {
    font-weight: 600;
    padding: 10px;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-box {
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-box p:first-child {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.info-box p:last-child {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Results panel - bottom right */
.results-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    max-height: 75vh;
    overflow-y: auto;
    z-index: 400;
    backdrop-filter: blur(10px);
}

.results-panel.hidden {
    display: none;
}

.results-panel h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    margin-top: 0;
}

.results-panel > p {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.result-box {
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.result-box p {
    margin: 4px 0;
    font-size: 0.85rem;
}

.result-box p:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.result-box p:last-child {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 500;
}

.result-box.full-width {
    grid-column: 1 / -1;
}

/* Attempts display */
#attemptsDisplay {
    color: var(--text-primary);
    font-size: 1.2rem;
    letter-spacing: 0.3em;
}

/* Share button */
.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:disabled {
    background-color: #10b98155;
    cursor: not-allowed;
    transform: none;
}

footer {
    background-color: var(--card-bg);
    text-align: center;
    color: var(--text-secondary);
    padding: 12px 20px;
    border-top: 2px solid var(--border-color);
    font-size: 0.9rem;
}

/* Leaflet customization */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content {
    font-size: 0.9rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .stats {
        gap: 15px;
        font-size: 0.85rem;
    }

    .info-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .guess-panel {
        bottom: auto;
        top: 50%;
        left: 10px;
        right: 10px;
        max-width: none;
        transform: translateY(-50%);
    }

    .results-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .button-group {
        flex-direction: row;
    }

    .btn {
        flex: 1;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .stats {
        gap: 12px;
        font-size: 0.75rem;
    }

    .info-panel {
        top: 5px;
        left: 5px;
        right: 5px;
        padding: 10px;
    }

    .guess-panel {
        top: 55%;
        left: 5px;
        right: 5px;
        padding: 10px;
    }

    .results-panel {
        bottom: 5px;
        right: 5px;
        left: 5px;
        padding: 10px;
        max-height: 40vh;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}
