:root {
    --primary-color: #e60050;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --modal-bg: #fff;
    --border-radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

p {
    color: #666;
    font-size: 0.9rem;
}

/* Map specific styles */
.map-container {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background: #fff;
}

#mensaMap {
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
}

#pinsOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Pin Styles */
.pin {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Standard Pin Marker */
.pin-marker {
    width: 24px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='%23e60050' d='M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.pin.mine .pin-marker {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='%23007bff' d='M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z'/%3E%3C/svg%3E");
}

/* Stickman Style */
.pin.stickman .pin-marker {
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23333' d='M256 64a64 64 0 1 0 0 128 64 64 0 1 0 0-128zM192 256v192c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V256h64v192c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V224c0-35.3-28.7-64-64-64H96c-35.3 0-64 28.7-64 64v224c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V256h64z'/%3E%3C/svg%3E");
}

/* Photo Style */
.pin.photo .pin-marker {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    background-image: none; /* Set via inline style */
}

/* Emoji Styles */
.pin.cigarette .pin-marker,
.pin.eggplant .pin-marker {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    background-image: none;
}

.pin.cigarette .pin-marker::after {
    content: "🚬";
}

.pin.eggplant .pin-marker::after {
    content: "🍆";
}

.pin.photo.mine .pin-marker {
    border-color: #007bff;
}

.pin-name {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Footer Button */
.mensamax-btn {
    display: inline-block;
    background-color: #333;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-align: center;
}

.mensamax-btn:hover {
    background-color: #555;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.modal-content p {
    margin-bottom: 20px;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 20px;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

/* Style Selector */
.style-selector {
    text-align: left;
    margin-bottom: 20px;
}

.style-selector > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
}

.style-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.style-option {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid transparent;
}

.style-option:has(input:checked) {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Camera UI */
#cameraContainer {
    margin-bottom: 20px;
}

#cameraContainer.hidden {
    display: none;
}

#cameraPreview {
    width: 100%;
    border-radius: 8px;
    background: #000;
    margin-bottom: 10px;
    transform: scaleX(-1); /* Mirror effect */
}

#photoResult {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: 3px solid var(--primary-color);
}

#photoResult.hidden {
    display: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.spacer {
    flex-grow: 1;
}

button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

.primary-btn:hover {
    background-color: #cc0047;
}

.secondary-btn {
    background-color: #eee;
    color: #333;
}

.secondary-btn:hover {
    background-color: #ddd;
}

.danger-btn {
    background-color: #ffcccc;
    color: #cc0000;
    padding: 10px 14px;
}

.danger-btn:hover {
    background-color: #ffb3b3;
}

.hidden {
    display: none !important;
}

@media (min-width: 600px) {
    .container {
        padding: 40px;
    }
}
