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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 12px;
    padding-bottom: 80px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.app-header h1 {
    font-size: 20px;
    margin-bottom: 5px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 20px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #a0aec0;
    font-size: 12px;
    padding: 8px;
    border-radius: 12px;
}

.nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-item span:first-child {
    font-size: 24px;
    margin-bottom: 4px;
}

.momentos-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.momento-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.momento-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #2d3748;
}

.momento-card p {
    font-size: 14px;
    color: #a0aec0;
    margin-bottom: 16px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
}

.camera-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

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

.camera-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.95);
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.capture-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 4px solid #667eea;
    cursor: pointer;
}

.close-camera {
    background: #f56565;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
}

.foto-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
}

.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
}

.foto-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.foto-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.foto-info {
    padding: 12px;
}

.foto-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.foto-info p {
    font-size: 12px;
    color: #a0aec0;
}

.modal-foto {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-foto img {
    max-width: 90%;
    max-height: 80%;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-container {
    padding: 16px;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

#buscador {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 40px;
}

.loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.alert {
    padding: 16px;
    border-radius: 12px;
    margin: 16px;
    font-size: 14px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
}

@media (max-width: 480px) {
    .fotos-grid {
        grid-template-columns: 1fr;
    }
    
    .capture-btn {
        width: 70px;
        height: 70px;
    }
}