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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Pantalla de bienvenida con fondo de naturaleza */
#welcome-screen {
    background-image: url('https://images.unsplash.com/photo-1518495973542-4542c06a5843?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

#welcome-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.app-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.welcome-container h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.welcome-container p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin-bottom: 40px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.language-selector {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.language-selector h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.lang-btn.active {
    background: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 4px 20px rgba(255,255,255,0.3);
}

.chrome-recommendation {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.chrome-icon {
    font-size: 1.5rem;
}

.chrome-recommendation p {
    color: rgba(255,255,255,0.95);
    font-size: 0.9rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.primary-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

/* Pantalla de permisos */
.permission-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.location-icon {
    font-size: 4rem;
    margin-bottom: 30px;
}

.permission-container h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.permission-container p {
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 400px;
    line-height: 1.5;
}

/* Pantalla principal */
#main-screen {
    background: #f5f5f5;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h2 {
    font-weight: 300;
    font-size: 1.5rem;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.view-btn:hover {
    background: rgba(255,255,255,0.3);
}

.view-btn.active {
    background: rgba(255,255,255,0.4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.precision-display {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid #eee;
}

.precision-info, .coordinates-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.precision-info:last-child, .coordinates-info:last-child {
    margin-bottom: 0;
}

.precision-icon {
    font-size: 1.2rem;
}

#precision-value {
    font-weight: 600;
    color: #667eea;
}

#coordinates-value {
    font-weight: 500;
    font-family: monospace;
    font-size: 0.8rem;
}

#map {
    height: 300px;
    width: 100%;
}

.camera-container {
    position: relative;
    background: #000;
    height: 300px;
    overflow: hidden;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-canvas {
    display: none;
}

#photo-preview {
    display: none;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.controls {
    background: white;
    padding: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.control-btn {
    flex: 1;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.camera-btn {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
}

.send-btn {
    background: linear-gradient(45deg, #43e97b, #38f9d7);
    color: white;
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10000;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    color: white;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 480px) {
    .language-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    #map {
        height: 250px;
    }
    
    .camera-container {
        height: 250px;
    }
}

/* Ocultar puntos de interés del mapa */
.leaflet-control-container .leaflet-top.leaflet-right {
    display: none !important;
}

.leaflet-control-attribution {
    display: none !important;
}