* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5em;
    padding: 10px;
}

.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Estilos del Mapa */
.map-section {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #e9ecef;
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-controls button {
    flex: 1;
    padding: 12px;
    font-size: 0.9em;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.map-controls button:hover {
    background: #0056b3;
}

.map-controls button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Estilos del Formulario */
.form-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #007bff;
}

input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
    width: 100%;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Status y Sincronización */
.status {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    border-left: 4px solid #2196f3;
}

#btnSincronizar {
    background-color: #28a745;
    margin-top: 10px;
}

#btnSincronizar:hover {
    background-color: #218838;
}

/* Sección de Instalación */
.install-section {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.install-btn {
    background: #fff !important;
    color: #667eea !important;
    border: none;
    padding: 15px 25px !important;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    margin-bottom: 10px;
    width: auto !important;
    display: inline-block !important;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.install-btn.installing {
    background: #ffc107 !important;
    color: #000 !important;
}

.install-btn.installed {
    background: #28a745 !important;
    color: white !important;
}

.install-help {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.new-badge {
    background: #ff4757;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 5px;
    vertical-align: super;
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.install-btn.pulse {
    animation: pulse 2s infinite;
}

/* Lista de Registros */
.registros-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.registro-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: transform 0.2s;
}

.registro-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.registro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.registro-header strong {
    color: #2c3e50;
    font-size: 1.1em;
}

.sync-status.synced {
    color: #28a745;
    font-size: 0.9em;
    font-weight: bold;
}

.sync-status.pending {
    color: #ffc107;
    font-size: 0.9em;
    font-weight: bold;
}

.registro-coords {
    color: #6c757d;
    margin-bottom: 5px;
    font-family: monospace;
    font-size: 0.9em;
}

.registro-date {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.registro-pending {
    background: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    text-align: center;
    margin-top: 5px;
}

/* Notificaciones */
.custom-notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    #map {
        height: 300px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    .map-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    button {
        padding: 10px;
        font-size: 13px;
    }
    
    input {
        padding: 10px;
        font-size: 13px;
    }
    
    .install-btn {
        padding: 12px 20px !important;
        font-size: 14px;
    }
}

/* Estilos para modo PWA */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .container {
        padding-top: 5px;
    }
    
    h1 {
        margin-bottom: 15px;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}