/* styles.css */
:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --dark: #34495e;
    --light: #ecf0f1;
    --gray: #95a5a6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    padding: 20px 15px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f8f9fa;
    -webkit-appearance: none;
    appearance: none;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.coordenadas-group {
    display: flex;
    gap: 10px;
}

.coordenadas-group .form-group {
    flex: 1;
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

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

.btn-primary:active {
    background-color: #2980b9;
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    margin-top: 10px;
}

.btn-secondary:active {
    background-color: #27ae60;
    transform: scale(0.98);
}

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

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

.btn-sm {
    padding: 10px 15px;
    width: auto;
    display: inline-block;
}

.btn:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
}

.camera-preview {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
}

.camera-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-icon {
    font-size: 3rem;
    color: var(--gray);
}

.file-input {
    display: none;
}

.status {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.status.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.gps-status {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.gps-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.gps-acquiring {
    color: #e67e22;
}

.gps-acquired {
    color: var(--secondary);
}

.gps-error {
    color: var(--danger);
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 0.8rem;
}

/* Pantalla de login */
#loginScreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 25px;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.login-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark);
}

/* Navbar de usuario */
.user-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mejoras de usabilidad para móviles */
@media (max-width: 480px) {
    input, select, textarea {
        padding: 16px;
    }
    
    .btn {
        padding: 18px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-nav {
        width: 100%;
        justify-content: space-between;
    }
}

/* Efectos de carga */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Ocultar elementos */
.hidden {
    display: none;
}

.credential-hint {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

.historial-registro {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.historial-header {
    display: flex;
    justify-content: space-between;
}

.historial-coords {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.historial-container {
    max-height: 300px;
    overflow-y: auto;
}
/* Estilos para la vista previa de la cámara y fotos */
.camera-preview {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
}

.camera-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-icon {
    font-size: 3rem;
    color: var(--gray);
}

.file-input {
    display: none;
}

.file-info {
    display: none;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--gray);
    text-align: center;
}

/* Estilos para fotos en el historial */
.historial-registro img {
    max-width: 100%;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin-top: 8px;
}
.menu-category {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.menu-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.menu-header:hover {
    background-color: #e9ecef;
}

.menu-header.active {
    background-color: var(--primary);
    color: white;
}

.menu-header i:first-child {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.menu-header span {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.menu-header.active .dropdown-icon {
    transform: rotate(180deg);
}

.menu-dropdown {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background-color: white;
}

.menu-dropdown.active {
    max-height: 200px;
    opacity: 1;
    visibility: visible;
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-item i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.menu-item span {
    flex: 1;
    font-size: 0.95rem;
    color: var(--dark);
}

.menu-item:hover span {
    color: var(--primary);
}

/* Efectos de animación para el menú */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-dropdown.active .menu-item {
    animation: slideDown 0.3s ease forwards;
}

.menu-dropdown.active .menu-item:nth-child(1) {
    animation-delay: 0.05s;
}

.menu-dropdown.active .menu-item:nth-child(2) {
    animation-delay: 0.1s;
}

/* Responsive */
@media (max-width: 480px) {
    .menu-header {
        padding: 18px 15px;
    }
    
    .menu-item {
        padding: 16px 15px;
    }
    
    .menu-header span,
    .menu-item span {
        font-size: 0.95rem;
    }
}